Ir al contenido


Foto

[TRUCOS DELPHI] Mostrar / Ocultar la Barra de Titulos.


  • Por favor identifícate para responder
No hay respuestas en este tema

#1 sir.dev.a.lot

sir.dev.a.lot

    Advanced Member

  • Miembros
  • PipPipPip
  • 545 mensajes
  • Location127.0.0.1

Escrito 23 agosto 2016 - 01:57

[TRUCOS DELPHI] Mostrar / Ocultar la Barra de Titulos.


delphi
  1. //Ocultar
  2. procedure TForm1.HideTitlebar;
  3. var
  4. Style : longint;
  5. begin
  6. if BorderStyle = bsNone then Exit;
  7. Style := GetWindowLong(Handle, gwl_Style);
  8. if (Style and ws_Caption) = ws_Caption then
  9. begin
  10. case BorderStyle of
  11. bsSingle,
  12. bsSizeable: SetWindowLong(Handle, gwl_Style, Style and
  13. (not (ws_Caption)) or ws_border);
  14. bsDialog: SetWindowLong(Handle, gwl_Style, Style and
  15. (not (ws_Caption)) or ds_modalframe or ws_dlgframe);
  16. end;
  17. Height := Height - getSystemMetrics(sm_cyCaption);
  18. Refresh;
  19. end;
  20. end;
  21.  
  22. //Mostrar
  23. procedure TForm1.ShowTitlebar;
  24. var
  25. Style : longint;
  26. begin
  27. if BorderStyle = bsNone then Exit;
  28. Style := GetWindowLong(Handle, gwl_Style);
  29. if (Style and ws_Caption) <> ws_Caption then
  30. begin
  31. case BorderStyle of
  32. bsSingle,
  33. bsSizeable: SetWindowLong(Handle, gwl_Style, Style or ws_Caption or
  34. ws_border);
  35. bsDialog: SetWindowLong(Handle, gwl_Style, Style or ws_Caption or
  36. ds_modalframe or ws_dlgframe);
  37. end;
  38. Height := Height + getSystemMetrics(sm_cyCaption);
  39. Refresh;
  40. end;
  41. end;

Saludos!


  • 2




IP.Board spam blocked by CleanTalk.