Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   C++ Builder (https://www.clubdelphi.com/foros/forumdisplay.php?f=13)
-   -   formulario desvanecido mientras aparece??? (https://www.clubdelphi.com/foros/showthread.php?t=56148)

Negriz 08-05-2008 18:37:13

formulario desvanecido mientras aparece???
 
hola como estan???

mi pregunta es en el c++ builder como puedo hacer que un formulario al al activarse se vea desvanecido mientras aparece.

como uan especie de splash screen.

Es una animacion que pone alli??? si es asi como la pongo alli???.

cHackAll 08-05-2008 22:40:22

1 Archivos Adjunto(s)
Código:

__fastcall TForm2::TForm2(TComponent* Owner)
  : TForm(Owner)
{
 SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) | WS_EX_LAYERED);
 SetLayeredWindowAttributes(Handle, 0, 255, LWA_ALPHA);
}

void __fastcall TForm2::FormActivate(TObject *Sender)
{
 for (int blend = 200; blend < 256; blend+=5)
  {
  SetLayeredWindowAttributes(Handle, 0, blend, LWA_ALPHA);
  Sleep(10);
  }
}

void __fastcall TForm2::FormDeactivate(TObject *Sender)
{
 for (int blend = 255; blend > 200; blend-=5)
  {
  SetLayeredWindowAttributes(Handle, 0, blend, LWA_ALPHA);
  Sleep(10);
  }
}


Negriz 08-05-2008 23:50:38

Cita:

Empezado por cHackAll (Mensaje 285376)
Código:

__fastcall TForm2::TForm2(TComponent* Owner)
  : TForm(Owner)
{
 SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) | WS_EX_LAYERED);
 SetLayeredWindowAttributes(Handle, 0, 255, LWA_ALPHA);
}

void __fastcall TForm2::FormActivate(TObject *Sender)
{
 for (int blend = 200; blend < 256; blend+=5)
  {
  SetLayeredWindowAttributes(Handle, 0, blend, LWA_ALPHA);
  Sleep(10);
  }
}

void __fastcall TForm2::FormDeactivate(TObject *Sender)
{
 for (int blend = 255; blend > 200; blend-=5)
  {
  SetLayeredWindowAttributes(Handle, 0, blend, LWA_ALPHA);
  Sleep(10);
  }
}


gracias lo voy a probar.

Negriz 09-05-2008 18:04:08

jajaja...
que bien era justo lo que buscaba.

Pero una pregunta: Cuando el formulario principal es el que se activa con este efecto se ve negro???
por que???
solo es curiosidad.

Muchas graicas.

cHackAll 09-05-2008 19:50:31

1 Archivos Adjunto(s)
Al parecer si es "normal". seguramente un problema de la VCL (si es que asi se llama en BCB);

Dejo otro adjunto con una solucion menos técnica.

Saludos

Negriz 09-05-2008 21:30:04

Cita:

Empezado por cHackAll (Mensaje 285641)
Al parecer si es "normal". seguramente un problema de la VCL (si es que asi se llama en BCB);

Dejo otro adjunto con una solucion menos técnica.

Saludos

Ok... voy a mirar.
Muchas gracias cHackAll.
Lo voy a revisar.

si si se llama vcl.

Gracias.


La franja horaria es GMT +2. Ahora son las 04:28:54.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi