Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Multiple Tabs

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Sat Feb 23, 2008 9:59 pm    Post subject: Multiple Tabs Reply with quote

For a web-browser, how would you make tabbed browsing?

I added a web browser onto TabPage1.

This is the Go Button:

Code:
WebBrowser1.Navigate(TextBox1.Text)


Now if I were to add onto TabPage2 a second web browser, It couldn't be:

Code:
WebBrowser1.Navigate(TextBox1.Text)


because it would load that url onto both tabs.

How do I stop that from happening without adding a second TextBox.

EDIT: I tried this and it doesn't work:

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button1.Enter
        If TabPage2.Enabled = True Then
            WebBrowser2.Navigate(TextBox1.Text)
            WebBrowser1.Enabled = False
        Else
            WebBrowser1.Navigate(TextBox1.Text)

        End If
        WebBrowser1.Navigate(TextBox1.Text)
    End Sub

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Feb 23, 2008 10:36 pm    Post subject: Reply with quote

Creating the controls at runtime would be a smarter way to go about this
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sat Feb 23, 2008 10:42 pm    Post subject: Reply with quote

Put a panel on your form, and then throw a tab control thing on the panel.

Resize it to where the empty space from the tab control is the only area left visible on the panel. Make the panel's double click event do something like (C#):

Code:

            WebBrowser wb = new WebBrowser();
            wb.Size = tabControl1.Size; //this should be fitted, I don't feel like it right now
            wb.Navigate("www.google.com");
            TabPage tp = new TabPage();
            tp.Controls.Add(wb);
            tp.Tag = wb;
            tabControl1.TabPages.Add(tp);


It's easy enough to translate to VB.

Now, for your Go button (once again, C#)

Code:

WebBrowser current = (WebBrowser)tabControl1.TabPages[tabControl1.TabIndex].Tag;
current.Navigate(whatever);


I think that should work.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Sat Feb 23, 2008 11:14 pm    Post subject: Reply with quote

samuri25404 wrote:
Put a panel on your form, and then throw a tab control thing on the panel.

Resize it to where the empty space from the tab control is the only area left visible on the panel. Make the panel's double click event do something like (C#):

Code:

            WebBrowser wb = new WebBrowser();
            wb.Size = tabControl1.Size; //this should be fitted, I don't feel like it right now
            wb.Navigate("www.google.com");
            TabPage tp = new TabPage();
            tp.Controls.Add(wb);
            tp.Tag = wb;
            tabControl1.TabPages.Add(tp);


It's easy enough to translate to VB.

Now, for your Go button (once again, C#)

Code:

WebBrowser current = (WebBrowser)tabControl1.TabPages[tabControl1.TabIndex].Tag;
current.Navigate(whatever);



Wait so... those codes are for VB c# and not just VB? That's what i'm using.
Edit: Its not working. I also tried changing a few things like WebBrowser current to WebBrowser1.

Ahh Idk what to doooo Shocked

_________________
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sun Feb 24, 2008 8:44 am    Post subject: Reply with quote

There's no such thing "VB C#", its just C#... convert it.
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Feb 24, 2008 9:59 am    Post subject: Reply with quote

Noo....

Google for a C# to VB.NET translator.

When you find one, put that code into it, and translate it.

Then, put in the code, where I told you to. There may be a few compile errors, and those you should just be able to fix yourself. Rolling Eyes

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
XxOsirisxX
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Oct 2006
Posts: 1597

PostPosted: Sun Feb 24, 2008 10:08 am    Post subject: Reply with quote

AndrewMan wrote:
samuri25404 wrote:
Put a panel on your form, and then throw a tab control thing on the panel.

Resize it to where the empty space from the tab control is the only area left visible on the panel. Make the panel's double click event do something like (C#):

Code:

            WebBrowser wb = new WebBrowser();
            wb.Size = tabControl1.Size; //this should be fitted, I don't feel like it right now
            wb.Navigate("www.google.com");
            TabPage tp = new TabPage();
            tp.Controls.Add(wb);
            tp.Tag = wb;
            tabControl1.TabPages.Add(tp);


It's easy enough to translate to VB.

Now, for your Go button (once again, C#)

Code:

WebBrowser current = (WebBrowser)tabControl1.TabPages[tabControl1.TabIndex].Tag;
current.Navigate(whatever);



Wait so... those codes are for VB c# and not just VB? That's what i'm using.
Edit: Its not working. I also tried changing a few things like WebBrowser current to WebBrowser1.

Ahh Idk what to doooo Shocked


There are no WebBrowser on the example, the WebBrowser is being created at run time.

wb takes the control of a the control WebBrowser. (To make it shorted, and it's the example used everywhere).

_________________

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites