📄 sampledocking.vb
字号:
Protected Sub DefineContentState(ByVal c As Content)
c.CaptionBar = _captionBars
c.CloseButton = _closeButtons
End Sub
Protected Sub DefineControlColors(ByVal c As Content)
' Only interested in Forms and Panels
If TypeOf c Is Form Or TypeOf c Is Panel Then
' Starting color depends on select menu option
Select Case _colorIndex
Case 0
c.Control.BackColor = SystemColors.Control
c.Control.ForeColor = SystemColors.ControlText
Case 1
c.Control.BackColor = Color.DarkSlateBlue
c.Control.ForeColor = Color.White
Case 2
c.Control.BackColor = Color.Firebrick
c.Control.ForeColor = Color.White
Case 3
c.Control.BackColor = Color.PaleGreen
c.Control.ForeColor = Color.Black
End Select
End If
End Sub
Protected Sub OnDeleteAll(ByVal sender As Object, ByVal e As EventArgs)
_manager.Contents.Clear()
End Sub
Protected Sub OnShowAll(ByVal sender As Object, ByVal e As EventArgs)
_manager.ShowAllContents()
End Sub
Protected Sub OnHideAll(ByVal sender As Object, ByVal e As EventArgs)
_manager.HideAllContents()
End Sub
Protected Sub OnExit(ByVal sender As Object, ByVal e As EventArgs)
Close()
End Sub
Protected Sub OnSaveFile1(ByVal sender As Object, ByVal e As EventArgs)
_manager.SaveConfigToFile("config1.xml")
End Sub
Protected Sub OnSaveFile2(ByVal sender As Object, ByVal e As EventArgs)
_manager.SaveConfigToFile("config2.xml")
End Sub
Protected Sub OnLoadFile1(ByVal sender As Object, ByVal e As EventArgs)
_manager.LoadConfigFromFile("config1.xml")
End Sub
Protected Sub OnLoadFile2(ByVal sender As Object, ByVal e As EventArgs)
_manager.LoadConfigFromFile("config2.xml")
End Sub
Protected Sub OnSaveArray1(ByVal sender As Object, ByVal e As EventArgs)
_slot1 = _manager.SaveConfigToArray()
End Sub
Protected Sub OnSaveArray2(ByVal sender As Object, ByVal e As EventArgs)
_slot2 = _manager.SaveConfigToArray()
End Sub
Protected Sub OnLoadArray1(ByVal sender As Object, ByVal e As EventArgs)
If Not (_slot1 Is Nothing) Then
_manager.LoadConfigFromArray(_slot1)
End If
End Sub
Protected Sub OnLoadArray2(ByVal sender As Object, ByVal e As EventArgs)
If Not (_slot2 Is Nothing) Then
_manager.LoadConfigFromArray(_slot2)
End If
End Sub
Protected Sub OnResizeBarDefault(ByVal sender As Object, ByVal e As EventArgs)
_manager.ResizeBarVector = -1
End Sub
Protected Sub OnUpdateRSBD(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = (_manager.ResizeBarVector = -1)
End Sub
Protected Sub OnResizeBar1(ByVal sender As Object, ByVal e As EventArgs)
_manager.ResizeBarVector = 1
End Sub
Protected Sub OnUpdateRSB1(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = (_manager.ResizeBarVector = 1)
End Sub
Protected Sub OnResizeBar5(ByVal sender As Object, ByVal e As EventArgs)
_manager.ResizeBarVector = 5
End Sub
Protected Sub OnUpdateRSB5(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = (_manager.ResizeBarVector = 5)
End Sub
Protected Sub OnResizeBar7(ByVal sender As Object, ByVal e As EventArgs)
_manager.ResizeBarVector = 7
End Sub
Protected Sub OnUpdateRSB7(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = (_manager.ResizeBarVector = 7)
End Sub
Protected Sub OnCaptionBars(ByVal sender As Object, ByVal e As EventArgs)
_captionBars = (_captionBars = False)
Dim c As Content
For Each c In _manager.Contents
c.CaptionBar = _captionBars
Next
End Sub
Protected Sub OnUpdateCaptionBars(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = _captionBars
End Sub
Protected Sub OnCloseButtons(ByVal sender As Object, ByVal e As EventArgs)
_closeButtons = (_closeButtons = False)
Dim c As Content
For Each c In _manager.Contents
c.CloseButton = _closeButtons
Next
End Sub
Protected Sub OnUpdateCloseButtons(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = _closeButtons
End Sub
Protected Sub OnAllowAllCloseButton(ByVal sender As Object, ByVal e As EventArgs)
_ignoreClose = 0
End Sub
Protected Sub OnUpdateAllowAll(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = (_ignoreClose = 0)
End Sub
Protected Sub OnIgnoreAllCloseButton(ByVal sender As Object, ByVal e As EventArgs)
_ignoreClose = 1
End Sub
Protected Sub OnUpdateIgnoreAll(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = (_ignoreClose = 1)
End Sub
Protected Sub OnIgnoreAllPanelButton(ByVal sender As Object, ByVal e As EventArgs)
_ignoreClose = 2
End Sub
Protected Sub OnUpdateIgnorePanel(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = (_ignoreClose = 2)
End Sub
Protected Sub OnIgnoreAllFormButton(ByVal sender As Object, ByVal e As EventArgs)
_ignoreClose = 3
End Sub
Protected Sub OnUpdateIgnoreForm(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = (_ignoreClose = 3)
End Sub
Protected Sub OnIgnoreAllTextboxButton(ByVal sender As Object, ByVal e As EventArgs)
_ignoreClose = 4
End Sub
Protected Sub OnUpdateIgnoreTextBox(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = (_ignoreClose = 4)
End Sub
Protected Sub OnAllowMinMax(ByVal sender As Object, ByVal e As EventArgs)
_manager.ZoneMinMax = (_manager.ZoneMinMax = False)
End Sub
Protected Sub OnUpdateAllowMinMax(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = _manager.ZoneMinMax
End Sub
Protected Sub OnPlainTabBorder(ByVal sender As Object, ByVal e As EventArgs)
_manager.PlainTabBorder = (_manager.PlainTabBorder = False)
End Sub
Protected Sub OnUpdatePlainTabBorder(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = _manager.PlainTabBorder
End Sub
Protected Sub OnColorDefault(ByVal sender As Object, ByVal e As EventArgs)
' Remember the new color scheme selected
_colorIndex = 0
' Define main Form back color
_filler.TextColor = SystemColors.MenuText
_filler.BackColor = SystemColors.Control
Me.BackColor = SystemColors.Control
' Define the menu/status bars
_topMenu.ResetColors()
_topMenu.Font = SystemInformation.MenuFont
_filler.Font = SystemInformation.MenuFont
_manager.ResetColors()
_manager.CaptionFont = SystemInformation.MenuFont
_manager.TabControlFont = SystemInformation.MenuFont
' Need to manually update the colors of created Panels/Forms
Dim c As Content
For Each c In _manager.Contents
DefineControlColors(c)
Next
End Sub
Protected Sub OnUpdateDefault(ByVal sender As Object, ByVal e As EventArgs)
Dim updateCommand As MenuCommand = sender
updateCommand.Checked = (_colorIndex = 0)
End Sub
Protected Sub OnColorSlateBlue(ByVal sender As Object, ByVal e As EventArgs)
' Remember the new color scheme selected
_colorIndex = 1
' Define main Form back color
Me.BackColor = Color.DarkSlateBlue
' Define the menu/status bars
_topMenu.TextColor = Color.White
_topMenu.BackColor = Color.DarkSlateBlue
_topMenu.SelectedTextColor = Color.White
_topMenu.SelectedBackColor = Color.SteelBlue
_topMenu.Font = New Font("Garamond", 10.0F)
' Define the TabControl appearance
_filler.TextColor = Color.White
_filler.BackColor = Color.DarkSlateBlue
_filler.Font = New Font("Garamond", 10.0F)
If _style = VisualStyle.IDE Then
_topMenu.HighlightTextColor = Color.Black
_topMenu.HighlightBackColor = Color.SlateGray
Else
_topMenu.HighlightTextColor = Color.White
_topMenu.HighlightBackColor = Color.DarkSlateBlue
End If
' Define docking window colors
_manager.BackColor = Color.DarkSlateBlue
_manager.InactiveTextColor = Color.White
_manager.ActiveColor = Color.SteelBlue
_manager.ActiveTextColor = Color.White
_manager.ResizeBarColor = Color.DarkSlateBlue
_manager.CaptionFont = New Font("Garamond", 10.0F)
_manager.TabControlFont = New Font("Garamond", 10.0F)
' Need to manually update the colors of created Panels/Forms
Dim c As Content
For Each c In _manager.Contents
DefineControlColors(c)
Next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -