[RESOLVED] How To Load In Combo Box ?
Hay All :wave: I Want To Learn
How To Load In Combo Box Well I Am learning Web Browser in vb
So I Come Up With A Web Page That has Some Like This
Code:
<select name="cons">
<option value=starts>Starts With</option>
<option value=contains>Contains</option>
<option value=exactly>is Exactly</option>
</select>
option to choose so What I Want To No is How Do You Make "Starts With And Contains" Ect... Load In Combo Box And Wen I choose In My Combo Box My App Will Do It In Web Browser ::confused:
Re: How To Load In Combo Box ?
if u mean on a form...
cboControl.AddItem "Male"
cboControl.additem "Female"
Re: How To Load In Combo Box ?
also.... you know if you want to pass the info to a web page, you can do it using the POST command of the webbrowser - so you have no HTML requirements to get the input, and dont nesecarily need to use a web browser either... you can use an Internet transfer control to just post the info to a server, and get a response... :) - FYI :)
Re: How To Load In Combo Box ?
Hay All I Found Out How To Add In Combo Box I Used AddItem But I Still Dont No How To Set It's value
Re: How To Load In Combo Box ?
I Think It Needs To Be Some Thing Like This
vb Code:
If Combo1.Text = "Starts With" Then
???????? (cons).Value = starts
I Dont No If It's Right But I Think The Code Maybe Some Thing Like That
Re: How To Load In Combo Box ?
Re: How To Load In Combo Box ?
Quote:
Originally Posted by
koolsid
What is "cons" ?
This Bro
--------> <select name="cons"> <--------
See The Html Source
Re: How To Load In Combo Box ?
try
wb.document.all("cons").value = combo1.text
Re: How To Load In Combo Box ?
Yeah I saw that... but what is it?
Re: How To Load In Combo Box ?
Quote:
Originally Posted by
westconn1
try
wb.document.all("cons").value = combo1.text
Not Working Bro
Ok Here's More Info
See This Link https://in.edit.yahoo.com/registration?
It registration For Yahoo Id Now I make A Test Tool Like
This http://i30.tinypic.com/2ekhurl.jpg
at The Yahoo Page It's Asking For Gender Now I select Male In My Tool How Can I Make My Tool Do It In web browser Html Soure Is
Code:
<select name="gender" id="gender" class="" tabindex="3">
<option value="" SELECTED >- Select One -</option>
<option value="m" >Male</option>
<option value="f" >Female</option></select>
Re: How To Load In Combo Box ?
This has nothing to do with VB6 - Moved to HTML
Re: How To Load In Combo Box ?
this works in the yahoo
wb.document.all("gender").Value = "f"
Re: How To Load In Combo Box ?
@ hack
maybe vb6, he is using webbrowser control
Re: How To Load In Combo Box ?
i'll expand on westconn's post for you
if you want to set the form value then...
Code:
dim sSelectedWebbrowserText as string
sSelectedWebbrowserText = WEBBROWSERCONTROLNAME.document.all("cons").value
dim i as integer
for i = 0 to FORMCOMBONAME.listcount-1
if FORMCOMBONAME.List(i) = sSelectedWebbrowserText then
FORMCOMBONAME.Listindex = i
exit for ' we have found the next, exit the loop to speed things on
end if
next i
not too sure with the web browser one... - but can you explain why you want to set the web browser types on your project if your using a form as a gui? - there are some instances you wanna do it, but like i said, its not always the best way... just slows things down :)
for some reason since i installed IE 8 i cant actually use my web brwser control - jst errors out on me :( - so cant really give much info... but:
i believe that something like
WEBBROWSERCONTROLNAME.document.all("cons").list("VALUE").selected = true
but im not too certain :( sry
Re: How To Load In Combo Box ?
thanks for All The Info Guys but As I Said I Am Newbie Here What I Really Want Is
One Of My friend Asked Me To Try To Make A Tool That Will Search Here
http://www.apcentralpower.com/search/search_hyd2.jsp
So I Posted A Post Here
http://www.vbforums.com/showthread.php?t=583275
I Used That Info In My Tool All Was Ok But Not The Combo In That Page i Had No Idea How To Put That Combo Box In My Tool
The Html Source i Put In This Post is From That Page
So Guys What Should I Do If
possible Please explain in detail
I tried Some Thing Like This
vb Code:
Private Sub Combo2_Change()
If Combo2.Text = "Starts With" Then
WebBrowser1.Document.All(cons).Value = starts
ElseIf Combo2.Text = "Contains" Then
WebBrowser1.Document.All(cons).Value = contains
ElseIf Combo2.Text = "is Exactly" Then
WebBrowser1.Document.All(cons).Value = exactly
End Sub
But It Did not Work
Re: How To Load In Combo Box ?
they are strings, not variables
WebBrowser1.Document.All(cons).Value = "starts"
Re: How To Load In Combo Box ?
[B]
Quote:
Originally Posted by
westconn1
they are strings, not variables
WebBrowser1.Document.All(cons).Value = "starts"
Newbie Here Bro I Understand they are strings Now What Do I Do With Them
Sorry If I Am taking Too Much Time Of Yours Guys
Re: How To Load In Combo Box ?
Quote:
Originally Posted by
_-Rs-_
WebBrowser1.Document.All("cons").Value = "starts"
-- again psting back to my origional point above... you realise that you can use the web browser post vars in the navigate sub of the browser to post your values, without needing to load the origional search page????
Re: How To Load In Combo Box ?
Quote:
Originally Posted by
_-Rs-_
Newbie Here Bro Ok I Understand they are strings Now What Do I Do With Them Ware To Put Code In Private Sub Combo2_Change Or Command1_Click Or Form_Load
i would use the combo Validate... :) - this runs when the control focus is lost...
Re: How To Load In Combo Box ?
Quote:
Originally Posted by
wpearsall
i would use the combo Validate... :) - this runs when the control focus is lost...
combo Validate Hmmm Bro :) Can You Make An example Source
With That Site http://www.apcentralpower.com/search/search_hyd2.jsp
It will Give Me A Good Idea About What Your Saying :ehh:
peace
Re: How To Load In Combo Box ?
Code:
Dim strFormData As String
'Length of the separator string must be 76. I think this is simply a limitation of the component I was using and not a rule.
strFormData = "-------------------------------------------------------------ZkdOkkdKjoHEEdZ" & vbCrLf
strFormData = strFormData & "Content-Disposition: form-data; name=""cons""" & vbCrLf
strFormData = strFormData & vbCrLf 'Extra carriage return before contents of multipart section
strFormData = strFormData & sCons & vbCrLf
strFormData = strFormData & "-------------------------------------------------------------ZkdOkkdKjoHEEdZ" & vbCrLf
strFormData = strFormData & "Content-Disposition: form-data; name=""nameasonbill""" & vbCrLf
strFormData = strFormData & vbCrLf 'Extra carriage return before contents of multipart section
strFormData = strFormData & txtNames.Text & vbCrLf
strFormData = strFormData & "-------------------------------------------------------------ZkdOkkdKjoHEEdZ" & vbCrLf
strFormData = strFormData & "Content-Disposition: form-data; name=""ero""" & vbCrLf
strFormData = strFormData & vbCrLf 'Extra carriage return before contents of multipart section
strFormData = strFormData & sAreaNo & vbCrLf
strFormData = strFormData & "-------------------------------------------------------------ZkdOkkdKjoHEEdZ" & vbCrLf
WebBrowser1.Navigate URL, , , , strFormData, _
"Content-Type: multipart/form-data; " & _
"boundary=-----------------------------------------------------------ZkdOkkdKjoHEEdZ"
if i give you this.... :) - its not the WHOLE thing, but you can add the fields you need, and need to get the POST URL.. - im not sure if its working, but i used that to send a form to login to my website from an old chat client i made... but my web browser is broke so :)
Re: How To Load In Combo Box ?
Quote:
Originally Posted by
_-Rs-_
Code:
Private Sub Combo1_Validate(Cancel As Boolean)
Select Case Combo1.ListIndex
Case 0:
WebBrowser1.Document.All("cons").Value = "starts"
Case 1:
WebBrowser1.Document.All("cons").Value = "contains"
Case 2:
WebBrowser1.Document.All("cons").Value = "exactly"
End Select
End Sub
Re: How To Load In Combo Box ?
Quote:
Originally Posted by
wpearsall
Code:
Private Sub Combo1_Validate(Cancel As Boolean)
Select Case Combo1.ListIndex
Case 0:
WebBrowser1.Document.All("cons").Value = "starts"
Case 1:
WebBrowser1.Document.All("cons").Value = "contains"
Case 2:
WebBrowser1.Document.All("cons").Value = "exactly"
End Select
End Sub
Thank You So Much Bro It Worked :thumb: Keep Rocking