delphi - Testing multiple TComboBox values at once -


I am a noob in delphi but please help.

I have 7 TComboBoxes on a form. Their values ​​are given names using them using a SQL query from the same table.

  Process TForm3.Button4Click (Sender: Tubbed); Start Q2. Stop it; Q2.SQL.Clear; Q2.SQL.Add ('Select Number'); Q2.SQL.Add ('FROM numbers.dbf'); Q2.RequestLive: True =; Q2.Open; Cb1.Items.Add (q2.FieldByName ('number') value.); Cb1.Text: = '? ? ? '; Cb2.Items.Add (q2.FieldByName ('number') value.); Cb2.Text: = '? ? ? '; ... ... ... End;   

Where CB1, CBT .... are TCobobox.

I'm trying to test them against their values ​​(text of all values) Click on them, especially if you select cb1 = 1 from the dropdown, Then if you select cb2 = 1 ... etc and you give the same number, you should give it an error message

  MessageDlg ('Check values: CB1 And CB2: the same values ​​have been recorded. ', M.TERR, MBOKennel, 0);   

Which method you use, I would recommend, I am battling for two days now.

Thanks in advance!

Create a new form with seven combo boxes ( style: = csDropDownList with). After that, create a TCMbox box of a

  versus composse: array [1.7];   

and start it:

  Process TForm1.FormCreate (Sender: Toubys); Combo started [1]: = combobox 1; Combo [2]: = combo box 2; Combo [3]: = comboox3; Combo [4]: ​​= combo box 4; Combo [5]: = combo box 5; Combo [6]: = combo box 6; Combo [7]: = combobox 7; End;   

Then you can do this only

  Process TForm1.Resultation (sender: tubage); If Longbull (starts from TComboBox (sender). Perform (CB_GETDROPPEDSTATE, 0, 0)) then exit; I: = Lower (combo) to high (combo) if the sender (lt;   

and VerifyUniqueness to OnChange of each combo box. In addition, you need

  process TForm1.ComboBoxesKeyUp (Sender: Tubect; ​​var key: Word; Shift: TShiftState); If key = VK_RETURN then VerifyUniquness (sender) begins; End;    

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -