Hello, i need help with a button function. i am working on an advanced program that uses a richtextbox and tabcontrol. I have 2 buttons for adding pages and removing pages. I need it so when you get to 10 pages the add pages button will disable. I know this is simple and i usually figure this kind of things out myself but i am having a hard time concentrating. Here is the code im using now but it is for a msgbox to show up:
Code:
Dim RTB As New RichTextBox
If A = 11 Then
MsgBox("you cannot have more than 10 tabs open!")
Else
TabControl1.TabPages.Add(1, "Page " & A)
TabControl1.SelectTab(A - 1)
RTB.Name = "TE"
RTB.ScrollBars = RichTextBoxScrollBars.Both
RTB.Dock = DockStyle.Fill
TabControl1.SelectedTab.Controls.Add(RTB)
A = A + 1
End If
Please help!