Wonderful wonderful wonderful .. What a method you are following to teach !!! .. Incredible .Fantastic I owe you so much Mr. Long - Regards from Tripoli - Libya Your brother : Mahmoud Hassan
Loop through the text file and add the values to the combobox. var myfile: textfile ; sLine : string ; Begin AssignFile( myfile , 'textfile_name.txt' ) ; Reset( myfile ) ; while NOT eof( myfile ) do begin readln( myfile, sLine ) ; combobox1.Items.Add( sLine ) ; end; CloseFile( myfile ) ;
Hello. Thank you very much for the detailed explanation. But there is a problem that once selected the item is not reset and the last one remains selected. To overcome this problem cmbx.itemindexI=-1; cmbx.text:='Please select..'; But that's more lines of code. How to write more concisely?
Not sure what you are asking. You can check to see if an item is selected by using an if statement: if cmbx.ItemIndex = -1 then showmessage('Please select') else begin //do code here for selected item
At the top of form2 you must add the file name of form1 (Unit1 or whatever its name is) under uses. Then you should be able to type sValue := Form1.comboxbox1.value If that doesnt work then try then name of the unit file of form 1 sValue := Unit1.comboxbox1.value
Wonderful wonderful wonderful .. What a method you are following to teach !!! .. Incredible .Fantastic
I owe you so much Mr. Long -
Regards from Tripoli - Libya
Your brother : Mahmoud Hassan
I'm so glad the videos have helped!
thank you this is so helpful
Pls I have a text file and I want some values on the text files to be shown on combobox ..any tips?
Loop through the text file and add the values to the combobox.
var myfile: textfile ;
sLine : string ;
Begin
AssignFile( myfile , 'textfile_name.txt' ) ;
Reset( myfile ) ;
while NOT eof( myfile ) do
begin
readln( myfile, sLine ) ;
combobox1.Items.Add( sLine ) ;
end;
CloseFile( myfile ) ;
Hello, is there a way to make the user unable to type text and have the default item selected as 0 or would i have to use a different component?
Hello. Thank you very much for the detailed explanation. But there is a problem that once selected the item is not reset and the last one remains selected. To overcome this problem
cmbx.itemindexI=-1;
cmbx.text:='Please select..';
But that's more lines of code. How to write more concisely?
Not sure what you are asking. You can check to see if an item is selected by using an if statement:
if cmbx.ItemIndex = -1 then showmessage('Please select')
else
begin
//do code here for selected item
How do you insert multiple options
Delphi would explode
@@adolflinkler8244 i exploded
Hello , I have a question for my pat. I want to use the data from a combobox on Form1 on another combobox in Form2. Can someone please help me?
At the top of form2 you must add the file name of form1 (Unit1 or whatever its name is) under uses. Then you should be able to type sValue := Form1.comboxbox1.value
If that doesnt work then try then name of the unit file of form 1
sValue := Unit1.comboxbox1.value
@@MrLongITandCAT thank you!