[quote=mailto:info@delphitips.comGustav Evertsson]
How can I get a horizontal scrollbar on a list box?
Send a LB_SetHorizontalExtent message to the listbox's window handle.For example, the message could be sent in the form's OnCreate:
procedure TForm1.FormCreate(Sender: TObject);
begin
SendMessage(Listbox1.Handle, LB_SetHorizontalExtent, 1000, Longint(0));
end;
---------------------------------------------End----------------------------------------------
How to hide the main form ?
If you do not want your program starting up showing your main form, then add this line in your project (DPR) file, just after the Application.Initialize line.
Application.ShowMainForm := False;
---------------------------------------------End----------------------------------------------
How to hide the Titlebar ?
//Here is how to hide the titlebar:
Procedure TYourFormName.HideTitlebar;
Var
Save : LongInt;
Begin
If BorderStyle=bsNone then Exit;
Save:=GetWindowLong(Handle,gwl_Style);
If (Save and ws_Caption)=ws_Caption then
Begin
Case BorderStyle of bsSingle,
bsSizeable : SetWindowLong(Handle,gwl_Style,Save and
(Not(ws_Caption)) or ws_border);
bsDialog : SetWindowLong(Handle,gwl_Style,Save and
(Not(ws_Caption)) or ds_modalframe or ws_dlgframe);
End;
Height:=Height-getSystemMetrics(sm_cyCaption);
Refresh;
End;
end;
//And here is how we show it again:
Procedure TYourFormName.ShowTitlebar;
Var
Save : LongInt;
begin
If BorderStyle=bsNone then Exit;
Save:=GetWindowLong(Handle,gwl_Style);
If (Save and ws_Caption)<>ws_Caption then
Begin
Case BorderStyle of bsSingle,
bsSizeable : SetWindowLong(Handle,gwl_Style,Save or
ws_Caption or ws_border);
bsDialog : SetWindowLong(Handle,gwl_Style,Save or
ws_Caption or ds_modalframe or ws_dlgframe);
End;
Height:=Height+getSystemMetrics(sm_cyCaption);
Refresh;
End;
end;
---------------------------------------------End----------------------------------------------
How to make a TComboBox drop?
There is a windows API call to do it.
function SendMessage(Handle of the ComboBox, 1039, 1, 0);
So, if I had a TComboBox that was named LouieCombo, I would use the following code:
Procedure DropCombo(LouieCombo : TComboBox);
var
ReturnValue : Longint;
begin
ReturnValue := SendMessage(LouieCombo.Handle, 1039, 1, 0);
end;
---------------------------------------------End----------------------------------------------
[/quote]