Choose from list of text but show as numbers when inputted (Explained)
Hello All;
Well, done scared away half of the people already just with the title.
I am currently working on a Web Browser program, that will allow the user
to fill out a form
that is included in the project, and then visit the particular web page, and
set the information to the form on the page.
Now this is the problem that I am having with the code that I am using;
---Example---
I am using the following code to setform to webpage.
///button1click
MainForm.FillForm(MainForm.WebBrowser1,'email',edEmail.Text);
//this one works great, because it only uses a TEdit.
// Now with using the same code, I try to setform with a TComboBox, and
/ it will not setform for the ComboBox on the webpage.??
So I have tried this code
MainForm.WebBrowser.OleObject.Document.Forms.item(0).Q1.item(2).selected :=
true;
//this will pick the 3rd on in the ComboBox. What I need is a way to take
the information that I have in the
TComboBox.Strings in the Object Inspector and have it to where when you
choose a value (Text Value)
it will set in where the (0) is here, the oppropriate number that belongs to
the particular text string.
Something like this
----
procedure TInputForm.edHearAboutChange(Sender: TObject);
begin
edHearAbout.ItemIndex :=
StrToInt(edHearAbout.Items[edHearAbout.itemindex])*1;
end;
----
But with this code, above it is used for an integer, and when run, it says
that the text string that I have chosen is not a valid integer???
I hope that this is explained good enough,
Anyone help please.
Wayne
--
Carrz-Fox-Fire Promotions
Delphi 6 Pro SP2 | Win2k SP2|
http://www.carrz-fox-fire.com/Delphi/Delphi_Fire_Security/Main.asp