Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

Create a drop-down list in StringGride, of type Lookup in DBGride Find similar branches


Кто нибудь делал?   (2001-12-14 08:12) [0]

I tried to create a form with BorderStyle = bsNone and on it ListBox works, but at the time of its appearance the form header becomes inactive.
When using components, they can not go beyond the form.
Maybe someone has already overcome this.



Владислав   (2001-12-14 08:47) [1]

Can try the context menu?



Кто нибудь делал?   (2001-12-14 09:04) [2]

Thanks Vladislav.
I already thought about it: a redraw with a redraw, you need to look like a normal drop-down list.
Maybe you can ask the window what style so that it does not deactivate the main one?



Владислав   (2001-12-14 10:42) [3]

I can throw you a small example (in haste). Maybe something will help.



Mark_a   (2001-12-15 11:16) [4]

The form must have a StringGrid and ComboBox.
Use the following code:

procedure TForm1.FormCreate (Sender: TObject);
begin
{The height of the combobox "and not change, so instead of the combobox" a
we will change the height of the grid line "a!}
StringGrid1.DefaultRowHeight: = ComboBox1.Height;
StringGrid1.Cells [3,0]: = "Here is a list";
{Hide combobox}
ComboBox1.Visible: = False;
ComboBox1.Items.Add ("First item");
ComboBox1.Items.Add ("Second paragraph");
end;

procedure TForm1.ComboBox1Change (Sender: TObject);
begin
{Transfer the selected value from the ComboBox to the grid}
StringGrid1.Cells [StringGrid1.Col, StringGrid1.Row]: =
ComboBox1.Items [ComboBox1.ItemIndex];
ComboBox1.Visible: = False;
StringGrid1.SetFocus;
end;

procedure TForm1.StringGrid1SelectCell (Sender: TObject; ACol,
ARow: Integer; var CanSelect: Boolean);
was
R: TRect;
begin
if ((ACol = 3) AND (ARow <> 0)) then
begin
{The width and position of the ComboBox must match
cell StringGrid}
R: = StringGrid1.CellRect (ACol, ARow);
R.Left: = R.Left + StringGrid1.Left;
R.Right: = R.Right + StringGrid1.Left;
R.Top: = R.Top + StringGrid1.Top;
R.Bottom: = R.Bottom + StringGrid1.Top;
ComboBox1.Left: = R.Left + 1;
ComboBox1.Top: = R.Top + 1;
ComboBox1.Width: = (R.Right + 1) - R.Left;
ComboBox1.Height: = (R.Bottom + 1) - R.Top;
{Show combobox}
ComboBox1.Visible: = True;
ComboBox1.SetFocus;
end;
CanSelect: = True;
end;



vlv   (2001-12-15 11:43) [5]

In the RX library there is a class something like TPopupWindow ...



Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top









Memory: 0.57 MB
Time: 0.023 c
1-22084
Mikhalyov Dmitry
2001-12-19 14:53
2002.01.08
Event lock


3-21993
&#1050;&#1085;&#1086;&#1087;&#1082;&#1072;
2001-12-07 09:23
2002.01.08
Search in database (Very urgent !!!)


1-22147
vinni2000
2001-12-20 12:59
2002.01.08
Need advice on RichEdit !!!!!!!!


14-22366
Vlados
2001-11-05 10:41
2002.01.08
Plotting


3-21935
hair
2001-12-03 15:12
2002.01.08
Data Storage





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian Japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish