-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm1.vb
More file actions
44 lines (36 loc) · 1.59 KB
/
Form1.vb
File metadata and controls
44 lines (36 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports DevExpress.XtraEditors
Imports DevExpress.XtraBars.Docking2010.Views.Tabbed
Imports DevExpress.XtraBars.Docking2010.Views
Namespace ChildStandaloneForm
Public Partial Class Form1
Inherits XtraForm
Public Sub New()
InitializeComponent()
tabbedView1.FloatingDocumentContainer = FloatingDocumentContainer.DocumentsHost
End Sub
Private docs As List(Of BaseDocument) = New List(Of BaseDocument)()
Private Sub tabbedView1_QueryControl(ByVal sender As Object, ByVal e As QueryControlEventArgs)
Dim wb As MyBrowser = New MyBrowser()
wb.Dock = DockStyle.Fill
AddHandler wb.TitleChanged, AddressOf wb_TitleChanged
docs.Add(e.Document)
e.Control = wb
End Sub
Private Function FindDocument(ByVal documentControl As Object) As Document
For Each doc As Document In docs
If doc.Control Is documentControl Then Return doc
Next
Return Nothing
End Function
Private Sub wb_TitleChanged(ByVal sender As Object, ByVal e As EventArgs)
tabbedView1.ActiveDocument.Caption = TryCast(tabbedView1.ActiveDocument.Control, MyBrowser).Title
Dim activeFloatDoc As Document = FindDocument(sender) ' for floating documents
If activeFloatDoc IsNot Nothing Then activeFloatDoc.Caption = TryCast(sender, MyBrowser).Title
End Sub
End Class
End Namespace