Hi everyone,
I have a dialog box set up that has several tabs on it. This is a communications dialog box which handles incoming messages across my TCP/IP connection with a server. These messages can be related to different things, for example, and each tab on my dialog box is a representation of these different message types.
Each tab contains a text box and my messaging function writes incoming messages to the text box. That bit is easy; done.
One of the messaging functions that I want to implement is the ability to initialise outgoing messages to other users connected to the servers. Now I know how to do that as far as the network programming goes, it's easy. But I want people to be able to initialise messages with as many people as they need. Now each new message requires a dynamic tab to be created (and thus a dynamic text box) on our communications dialog. This I do not know how to do.
Other considerations are how I reference this tab and text box from my function
Any help would be much appreciated!
Regards,
Ady

Dynamic tabs and messages
sungrebe
There are lots of additional tricks.
for example
Dim a as new tabp("foo")
tabcontrol1.tabpages.add(a)
tabcontrol.tabpages(tabcontrol.tabpages.count-1).tag = a
That will store the class in the tag. To find the class all you have to do is to walk the tabs and reading the tabpagename
It's really a lot of fun.
Of course to delete the class
For each p as tabpage in tabcontrol1.tabpages
next
voila !!!!!!!
bballmitch
Sorry I missed the textbox part. You may need to touch this up a bit but I think you get the general idea
I'd do this a little differently (typed for memory)
Public Class Tabp
End Class
Then in your main code you do this:
Ed Santosusso
I'd do this a little differently (typed for memory)
Public Class Tabp
End Class
Then in your main code you do this:
Brad Roberts
Of Course the overloaded New routines should
Public Sub New(byval Name as string)
t = new TabPage
t.Name = Name
DealWithTextBox
end Sub
Public Sub New()
t = new TabPage
DealWithtextbox
end Sub
CJPO
Excellent, thanks!
And what about deleting it This is the next thing I'm trying and I can't get it to work haha!
Ady
kemal
Ok - I've tried the following code (and played around for a bit) but no joy. Any ideas
Dim
tmpCallsign As StringtmpCallsign =
"EGTT_CTR"TabControl1.TabPages.Add(tmpCallsign)
Dim Text1 As New TextBoxText1.Parent = TabControl1.TabPages(tmpCallsign)
Text1.Dock = DockStyle.Fill
Text1.Multiline =
TrueText1.ScrollBars = ScrollBars.Vertical
Me.Controls.Add(Text1)Maxbaviaan
I've managed to do it, thanks for your help.
Ady