|
-
Apr 9th, 2004, 06:34 PM
#1
Thread Starter
New Member
Assign RichTextBox to Tabcontrol
How do I get my newly created richtextbox inside my newly created tab?
The tab and richtextbox creator works fine, but how do I get it work. Right now it's just putting the RichTextBox behind the tab.
Code:
Function NTab()
Dim myTabPage As New TabPage
myTabPage.Text = "Untitled" & (TabControl1.TabPages.Count + 1)
TabControl1.TabPages.Add(myTabPage)
Dim ControlCount As Integer
Dim MyTextBox As RichTextBox
MyTextBox = New RichTextBox
Me.Controls.Add(MyTextBox)
MyTextBox.Size = New System.Drawing.Size(0, 8)
MyTextBox.Width = "600"
MyTextBox.Height = "520"
End Function
-Ryan L
http://denlou.com/
-
Apr 9th, 2004, 07:53 PM
#2
-
Apr 9th, 2004, 08:20 PM
#3
Thread Starter
New Member
ooooh *smack*
Must've been having a brain fart lol
-Ryan L
http://denlou.com/
-
Apr 10th, 2004, 03:40 PM
#4
-
Apr 21st, 2004, 10:53 AM
#5
Addicted Member
Re: Assign RichTextBox to Tabcontrol
You can do tis the .NET way instead of calling the Windows API.
You can do this by replacing:
Code:
Me.Controls.Add(MyTextBox)
with:
Code:
myTabPage.Controls.Add(MyTextBox)
It should work perfectly!
Originally posted by denlou
How do I get my newly created richtextbox inside my newly created tab?
The tab and richtextbox creator works fine, but how do I get it work. Right now it's just putting the RichTextBox behind the tab.
Code:
Function NTab()
Dim myTabPage As New TabPage
myTabPage.Text = "Untitled" & (TabControl1.TabPages.Count + 1)
TabControl1.TabPages.Add(myTabPage)
Dim ControlCount As Integer
Dim MyTextBox As RichTextBox
MyTextBox = New RichTextBox
Me.Controls.Add(MyTextBox)
MyTextBox.Size = New System.Drawing.Size(0, 8)
MyTextBox.Width = "600"
MyTextBox.Height = "520"
End Function
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
|