|
-
Sep 17th, 2003, 08:47 AM
#1
Thread Starter
Hyperactive Member
Finding tab based on tag *resolved*
im making an irc client...
here is the scenario
when you for example join a channel, it adds a tabpage to the tabcontrol. when this happens, i add to the newly created tabpage in its tag the channel name.
now with that in mind... say i join 2 channels... #channel1 and #channel2... the page's tag for #channel1 is #channel1 and the same for #channel2
now, when i recieve an message event, i need to know which tabpage to send the text to via its tag, and output the text to a textbox on that tab
how do i do that?
something like... if tabpage.tag = "#channel1" then print "blah" to txtbox on tabpage where tabpage.tag = "#channel1"
Last edited by Colonel Klink; Sep 18th, 2003 at 07:33 AM.
-
Sep 17th, 2003, 11:51 PM
#2
Lively Member
-
Sep 18th, 2003, 12:38 AM
#3
PowerPoster
You are going to do something like this:
Code:
string myString = "#Channel1";
foreach(TabPage page in TabControl.TabPages)
{
if(page.Text == myString)
{
// page is your tab page, do your code here.
}
}
-
Sep 18th, 2003, 01:07 AM
#4
Lively Member
Hellswraith with the simple solution!
Hey hell I wanted to use that but I can't figure out..to create the new tab page, whats the easiest way without using my own method to create a new tab page...I want to create it in the designer, then copy it over to create a new page...probably not possible like that..
Mitchel
-
Sep 18th, 2003, 06:29 AM
#5
Thread Starter
Hyperactive Member
omg hellswraith you little ripper!
thanks mate
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
|