我正在尝试制作一个新标签页,我的新标签页之间总是有空格
我是这个网站的新手,所以我无法发布图片,所以这是我的问题的链接http://i43.tinypic.com/rbbndk.png
继承我的新标签代码
Private Sub NewPageToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NewPageToolStripMenuItem.Click
Dim newpage As TabItem = TabControl1.CreateTab("newpage")
Dim textb As New RichTextBox
Dim filename As New TextBox
Dim sw As New StreamWriter(siteloc & filename.Text & ".hsp")
Dim createb As New Button
'Set the contents of the page
textb.ReadOnly = False
textb.Multiline = True
textb.Dock() = DockStyle.Top
textb.Height = 338
newpage.Text = "NewPage"
filename.Text = "Untitled"
filename.Location = New Point(5, 342)
filename.Width = 220
createb.Location = New Point(232, 342)
createb.Text = "Submit page"
'Add the tab to the page
newpage.AttachedControl.Controls.Add(filename)
newpage.AttachedControl.Controls.Add(textb)
newpage.AttachedControl.Controls.Add(createb)
TabControl1.Tabs.Add(newpage)
'select the tab
TabControl1.SelectedTab = newpage
'add button handlers
AddHandler createb.Click, AddressOf createb_Click
End Sub
我全神贯注地寻找答案而一无所获。我没有改变任何东西,我刚刚安装了dotnetbar。
答案 0 :(得分:1)
CreateTab方法已经将新创建的选项卡添加到Tabs集合(请参阅该方法的文档),因此您要将其添加两次。删除此代码: TabControl1.Tabs.Add(新页面)
希望这有帮助。