|
-
Aug 13th, 2008, 10:50 AM
#1
Thread Starter
Hyperactive Member
combobox help
Hi,
im a bit stuck,
im making a web browser,
i want peeps to be able to add sites to favorites
i have a web browser called web1
a text box called text1
i have a combo box called ComboBox1
and finaly a button nammed adtofav
when they click the button i want it to add the url typed in text1 to ComboBox1
im doing this wiht the following code
ComboBox1.Items.Add(Text1.Text)
what im now stuck on is making it so that when they click on an adress in ComboBox1 it send web1 to that page
not shure how to do this.
id love to see some sample code on how to do this
Thanx
-
Aug 13th, 2008, 11:00 AM
#2
Re: combobox help
Something like
vb.net Code:
Private Sub ComboBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.Click
System.Diagnostics.Process.Start(ComboBox1.Text)
End Sub
-
Aug 13th, 2008, 11:05 AM
#3
Re: combobox help
You might want to check for some text in the combobox first.
Code:
Private Sub ComboBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.Click
If ComboBox1.Text.Length > 0 Then
System.Diagnostics.Process.Start(ComboBox1.Text)
End If
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 13th, 2008, 11:13 AM
#4
Re: combobox help
You might want to handle the SelectedIndexChanged event instead, and do this:
VB.NET Code:
web1.Navigate(ComboBox1.SelectedItem.ToString())
-
Aug 13th, 2008, 11:18 AM
#5
Thread Starter
Hyperactive Member
Re: combobox help
how do i make it send web1 to the adress in combobox1?
-
Aug 13th, 2008, 11:19 AM
#6
Re: combobox help
To reuse the browser cxontrol just see Atheist's post. the "Navigate" method is the key there.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 13th, 2008, 11:28 AM
#7
Thread Starter
Hyperactive Member
Re: combobox help
where about do i type in web1.Navigate(ComboBox1.SelectedItem.ToString()) ?
-
Aug 13th, 2008, 11:30 AM
#8
Re: combobox help
VB.NET Code:
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged web1.Navigate(ComboBox1.SelectedItem.ToString()) End Sub
-
Aug 13th, 2008, 11:36 AM
#9
Thread Starter
Hyperactive Member
Re: combobox help
thanx every one, ive rated you all [resolved]
-
Aug 13th, 2008, 12:03 PM
#10
Re: combobox help
you need to go to the Thread Tools menu and select "Mark Thread as Resolved" so it will actually resolve the thread and be visible from the forum view level.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|