Page 1 of 1

help me out with this

Posted: Sat Aug 11, 2012 2:57 pm
by Shim
hello guys ,

i have a form and its GUI is custom and when i debugged it the program runs but when i click maximize it the form only gets large and the tools are just staying as before they doesnt get fit :D . so help me with this ?


let me know the best way of making a tabbed web browser let me know by your own idea ?

thank you cooll;

Re: help me out with this

Posted: Sat Aug 11, 2012 3:21 pm
by Filip
You should dock controls..

Re: help me out with this

Posted: Sat Aug 11, 2012 3:25 pm
by muttley1968
rather then dock you can set the ankors up and then controls move and work with the form resize

Re: help me out with this

Posted: Sat Aug 11, 2012 4:12 pm
by Shim
how can i do it ? docking ? and what about the tabbed web browser ?

Re: help me out with this

Posted: Sat Aug 11, 2012 4:39 pm
by muttley1968
Ancor is better as it allows buttons to move and textbox to resize and a tabbed browser try
Code: Select all
CType(Tabcontrol1.SelectedTab.Controls.Item(0), Windows.Forms.WebBrowser)
So you would use that like
Code: Select all
CType(Tabcontrol1.SelectedTab.Controls.Item(0), Windows.Forms.WebBrowser).gohome
simples :P and then to add a tab just do
Code: Select all
 Dim Browser As New Windows.Forms.WebBrowser
        Tabcontrol1.TabPages.Add("New Page")
        Tabcontrol1.SelectTab(int)
        Browser.Name = "Web Browser"
        Browser.Dock = DockStyle.Fill
        Tabcontrol1.SelectedTab.Controls.Add(Browser)
        int = int + 1
    CType(Tabcontrol1.SelectedTab.Controls.Item(0), Windows.Forms.WebBrowser).gohome 
        End If
Need anymore help just ask :P

Re: help me out with this

Posted: Sat Aug 11, 2012 7:02 pm
by M1z23R
To get each webbrowser in tabcontrol you can use something like this
Code: Select all
For each tb as tabpage in tabcontrol.tabpages
For each ctrl as control in tb.controls
if typeof ctrl is webbrowser then ctype(ctrl,webbrowser).refresh()
next
next
You can change the code a bit and make it to your needs.

And for the controls, you can make a panel, dock it top in tabpage, and then dock controls (back/forward...) left in the panel.

Re: help me out with this

Posted: Sat Aug 11, 2012 7:10 pm
by Shim
do i have to insert the web browser on the tab controt ? Or what should i do ?

Re: help me out with this

Posted: Sat Aug 11, 2012 7:24 pm
by M1z23R
Make one button on a form and change its text to "NewTab", that is visible and make one tabcontrol.
Double click the button and add this
Code: Select all
dim tb as new tabpage
tb.text ="new tab"
dim wb as new webbrowser
tb.controls.add(wb)
wb.dock = FILL
tabcontrol1.tabpages.add(tb)
Now add textbox and another button somewhere on the form.
Double click the button and add this
Code: Select all
For each ctrl as control in tabcontrol1.selectedtab.controls
If typeof ctrl is webbrowser then ctype(ctrl, webbrowser).navigate(textbox1.text)
next
What this does it navigates the webbrowser on current tab to a url in textbox1

Work around with that code and you will get to understand what does what here. it is simple english in code, not hard to understand.

Re: help me out with this

Posted: Sun Aug 12, 2012 12:34 am
by Shim
thanks for the good explanation :D it works now :D :D