Imports System.Windows.Forms Imports System.Diagnostics Imports System.Resources Imports Infragistics.Win Imports Infragistics.Win.UltraWinEditors Imports Infragistics.Win.UltraWinToolbars Imports Infragistics.Win.UltraWinSchedule Imports Infragistics.Win.UltraWinListView Public Class MDIParent1 Private ultraMonthViewMulti1 As UltraMonthViewMulti Private ultraListView1 As UltraListView Private rm As ResourceManager = WindowsApplication1.My.Resources.ResourceManager Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs) ' Create a new instance of the child form. Dim ChildForm As New System.Windows.Forms.Form ' Make it a child of this MDI form before showing it. ChildForm.MdiParent = Me m_ChildFormNumber += 1 ChildForm.Text = "Window " & m_ChildFormNumber ChildForm.Show() End Sub Private Sub OpenFile(ByVal sender As Object, ByVal e As EventArgs) Dim OpenFileDialog As New OpenFileDialog OpenFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments OpenFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*" If (OpenFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then Dim FileName As String = OpenFileDialog.FileName ' TODO: Add code here to open the file. End If End Sub Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Dim SaveFileDialog As New SaveFileDialog SaveFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments SaveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*" If (SaveFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then Dim FileName As String = SaveFileDialog.FileName ' TODO: Add code here to save the current contents of the form to a file. End If End Sub Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Me.Close() End Sub Private Sub CutToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) ' Use My.Computer.Clipboard to insert the selected text or images into the clipboard End Sub Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) ' Use My.Computer.Clipboard to insert the selected text or images into the clipboard End Sub Private Sub PasteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) 'Use My.Computer.Clipboard.GetText() or My.Computer.Clipboard.GetData to retrieve information from the clipboard. End Sub Private Sub CascadeToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Me.LayoutMdi(MdiLayout.Cascade) End Sub Private Sub TileVerticalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Me.LayoutMdi(MdiLayout.TileVertical) End Sub Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Me.LayoutMdi(MdiLayout.TileHorizontal) End Sub Private Sub ArrangeIconsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Me.LayoutMdi(MdiLayout.ArrangeIcons) End Sub Private Sub CloseAllToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) ' Close all child forms of the parent. For Each ChildForm As Form In Me.MdiChildren ChildForm.Close() Next End Sub Private m_ChildFormNumber As Integer Private Sub MDIParent1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.UltraToolbarsManager1.BeginUpdate() Try Me.InitializeApplicationMenu() Finally Me.UltraToolbarsManager1.EndUpdate() End Try End Sub Private Sub InitializeApplicationMenu() CreateApplicationMenu2010() InitializeApplicationMenu2010() CreateApplicationMenu() ToolbarSettings() End Sub Private Sub CreateApplicationMenu2010() ' Tools shown in office 2010 style Application Menu Dim newBtnTool As New ButtonTool("NewBtnTool") Me.UltraToolbarsManager1.Tools.Add(newBtnTool) newBtnTool.SharedProps.AppearancesSmall.Appearance.Image = imageListApplicationMenu2010.Images(14) newBtnTool.SharedProps.Caption = rm.GetString("New") Dim copyBtnTool As New ButtonTool("CopyBtnTool") Me.UltraToolbarsManager1.Tools.Add(copyBtnTool) copyBtnTool.SharedProps.AppearancesSmall.Appearance.Image = imageListApplicationMenu2010.Images(13) copyBtnTool.SharedProps.Caption = rm.GetString("Copy") Dim saveBtnTool As New ButtonTool("SaveBtnTool") Me.UltraToolbarsManager1.Tools.Add(saveBtnTool) saveBtnTool.SharedProps.AppearancesSmall.Appearance.Image = imageListApplicationMenu2010.Images(12) saveBtnTool.SharedProps.Caption = rm.GetString("Save") Dim recentlblTool As New LabelTool("RecentLabel") Me.UltraToolbarsManager1.Tools.Add(recentlblTool) recentlblTool.SharedProps.Caption = rm.GetString("RecentlyUsed") Dim recentTool As New ListTool("Recent") recentTool.DisplayCheckmark = False recentTool.ListToolItems.Add("doc1", rm.GetString("Document1")) recentTool.ListToolItems("doc1").Appearance.Image = ilLarge.Images(63) recentTool.ListToolItems.Add("doc2", rm.GetString("Document2")) recentTool.ListToolItems("doc2").Appearance.Image = ilLarge.Images(63) recentTool.ListToolItems.Add("doc3", rm.GetString("Document3")) recentTool.ListToolItems("doc3").Appearance.Image = ilLarge.Images(63) Me.UltraToolbarsManager1.Tools.Add(recentTool) ' Popup Menu Tool displayed in the Navigation Menu with its popup sub-item shown in the content area Dim popupMenu1 As New PopupMenuTool("PopupRecent") popupMenu1.Settings.PopupStyle = PopupStyle.Menu popupMenu1.SharedProps.Caption = rm.GetString("Recent") Me.UltraToolbarsManager1.Tools.Add(popupMenu1) popupMenu1.Tools.AddTool("RecentLabel") popupMenu1.Tools.AddTool("Recent") ultraMonthViewMulti1 = New UltraMonthViewMulti() ultraMonthViewMulti1.Width = 500 ultraMonthViewMulti1.Height = 500 ' Set CalendarLook property to get the viewStyle on UltraCalendarLook component ' ViewStyle set at design time for UltraCalendarLook component Me.Controls.Add(ultraMonthViewMulti1) ' PopupControlContainerTool displayed in the Navigation Menu with its popup sub-item shown in the content area Dim appmenu2010ContainerTool As New PopupControlContainerTool("PopupContainerControlTool") Me.UltraToolbarsManager1.Tools.Add(appmenu2010ContainerTool) appmenu2010ContainerTool.Control = Me.ultraMonthViewMulti1 appmenu2010ContainerTool.SharedProps.Caption = rm.GetString("Custom") Dim formatList As New ListTool("DocFormatTool") formatList.ListToolItems.Add("ExcelTool", rm.GetString("Excel")) formatList.ListToolItems(0).Appearance.Image = imageListApplicationMenu2010.Images(3) formatList.ListToolItems.Add("WordTool", rm.GetString("Word")) formatList.ListToolItems.Add("PowerpointTool", rm.GetString("Powerpoint")) formatList.ListToolItems.Add("PDFTool", rm.GetString("PDF")) Me.UltraToolbarsManager1.Tools.Add(formatList) ultraListView1 = New UltraListView() ultraListView1.Width = 500 ultraListView1.Height = 500 ultraListView1.View = Infragistics.Win.UltraWinListView.UltraListViewStyle.Icons ' Assign the ImageList control to WinListView ultraListView1.ViewSettingsIcons.ImageList = Me.ilLarge ultraListView1.Items.Add("Excel", rm.GetString("Excel")) ultraListView1.Items(0).Appearance.Image = 68 ultraListView1.Items.Add("Word", rm.GetString("Word")) ultraListView1.Items(1).Appearance.Image = 67 ultraListView1.Items.Add("Powerpoint", rm.GetString("Powerpoint")) ultraListView1.Items(2).Appearance.Image = 69 ultraListView1.Items.Add("PDF", rm.GetString("PDF")) ultraListView1.Items(3).Appearance.Image = 70 Dim listViewTool As New PopupControlContainerTool("ListViewTool") listViewTool.SharedProps.Caption = rm.GetString("Format") 'listViewTool.SharedProps.AppearancesSmall.Appearance.Image = imageListApplicationMenu2010.Images(10) Me.UltraToolbarsManager1.Tools.Add(listViewTool) listViewTool.Control = ultraListView1 Dim popupSend As New PopupMenuTool("SendPopupMenu") popupSend.Settings.PopupStyle = PopupStyle.Menu popupSend.SharedProps.Caption = rm.GetString("Send") Me.UltraToolbarsManager1.Tools.Add(popupSend) popupSend.Tools.AddTool("listViewTool") Dim exitBtnTool As New ButtonTool("ExitBtnTool") Me.UltraToolbarsManager1.Tools.Add(exitBtnTool) exitBtnTool.SharedProps.AppearancesSmall.Appearance.Image = imageListApplicationMenu2010.Images(15) exitBtnTool.SharedProps.Caption = rm.GetString("Exit") End Sub ''' Private Sub InitializeApplicationMenu2010() ' the office 2010 style application menu is displayed by clicking on the FileMenu ' button in the upper left corner of the ribbon. This object can be ' accessed via the ApplicationMenu2010 property of the Ribbon Dim appMenu2010 As ApplicationMenu2010 = Me.UltraToolbarsManager1.Ribbon.ApplicationMenu2010 ' the Navigation Menu and Content Area properties of the office 2010 style application menu ' provide control over the display of contents in the left and right ' sides of the application menu 2010 respectively ' Navigation Menu ' ============ appMenu2010.NavigationMenu.Tools.AddTool("NewBtnTool") appMenu2010.NavigationMenu.Tools.AddTool("CopyBtnTool") appMenu2010.NavigationMenu.Tools.AddTool("SaveBtnTool") appMenu2010.NavigationMenu.Tools.AddTool("PopupRecent") appMenu2010.NavigationMenu.Tools.AddTool("PopupContainerControlTool") appMenu2010.NavigationMenu.Tools.AddTool("SendPopupMenu") appMenu2010.NavigationMenu.Tools.AddTool("ExitBtnTool") End Sub Private Sub CreateApplicationMenu() '' Add some tabs Me.UltraToolbarsManager1.Ribbon.Tabs.Clear() Dim ribbonTab1 As RibbonTab = Me.UltraToolbarsManager1.Ribbon.Tabs.Add("Home") Dim ribbonTab2 As RibbonTab = Me.UltraToolbarsManager1.Ribbon.Tabs.Add("ribbon2") Dim ribbonTab3 As RibbonTab = Me.UltraToolbarsManager1.Ribbon.Tabs.Add("ribbon3") Dim ribbonTab4 As RibbonTab = Me.UltraToolbarsManager1.Ribbon.Tabs.Add("ribbon4") Dim ribbonTab5 As RibbonTab = Me.UltraToolbarsManager1.Ribbon.Tabs.Add("ribbon5") Dim ribbonTab6 As RibbonTab = Me.UltraToolbarsManager1.Ribbon.Tabs.Add("ribbon6") '' Add some groups 'Dim ribbonGroupClipboard As RibbonGroup = ribbonTab1.Groups.Add("Clipboard") Dim clipboardGroup As New RibbonGroup("Clipboard", rm.GetString("Clipboard")) Me.UltraToolbarsManager1.Ribbon.Tabs("Home").Groups.Add(clipboardGroup) clipboardGroup.LayoutDirection = RibbonGroupToolLayoutDirection.Horizontal clipboardGroup.PreferredToolSize = RibbonToolSize.ImageOnly 'Dim pasteTool As ToolBase = clipboardGroup.Tools.AddTool("Paste") 'pasteTool.InstanceProps.PreferredSizeOnRibbon = RibbonToolSize.Large Dim ribbonGroupFont As RibbonGroup = ribbonTab1.Groups.Add("Font") Dim ribbonGroupStyles As RibbonGroup = ribbonTab1.Groups.Add("Styles") '' Create some Contextual Tab Groups and put some tabs into groups. Me.UltraToolbarsManager1.Ribbon.ContextualTabGroups.Clear() Me.UltraToolbarsManager1.Ribbon.ContextualTabGroups.Add("contextualTabGroup1") ribbonTab3.ContextualTabGroupKey = "contextualTabGroup1" ribbonTab4.ContextualTabGroupKey = "contextualTabGroup1" Me.UltraToolbarsManager1.Ribbon.ContextualTabGroups.Add("contextualTabGroup2") ribbonTab5.ContextualTabGroupKey = "contextualTabGroup2" ribbonTab6.ContextualTabGroupKey = "contextualTabGroup2" Me.UltraToolbarsManager1.Ribbon.ContextualTabGroups("contextualTabGroup2").Visible = True ' Set the selected ribbon tab Me.UltraToolbarsManager1.Ribbon.SelectedTab = ribbonTab1 ' Set the border style for the Ribbon Groups Me.UltraToolbarsManager1.Ribbon.GroupBorderStyle = UIElementBorderStyle.Dashed Me.UltraToolbarsManager1.Office2007UICompatibility = True Me.UltraToolbarsManager1.Style = ToolbarStyle.Office2010 Me.UltraToolbarsManager1.Ribbon.ApplicationMenuButtonImage = Nothing Me.UltraToolbarsManager1.Ribbon.FileMenuButtonCaption = Nothing Me.UltraToolbarsManager1.Ribbon.FileMenuStyle = FileMenuStyle.ApplicationMenu2010 End Sub Private Sub ToolbarSettings() ' Disable the 'Personalized menus' feature by setting always showing full menus. ' When this property is left at its defaut setting (false), only recently used items are ' initially shown in menus. The hidden items (i.e., non-recently used items) are shown ' after a short delay. They can also be shown by clicking the downward pointing double ' chevron at the bottom of the menu. Me.UltraToolbarsManager1.AlwaysShowMenusExpanded = DefaultableBoolean.True '' Specify some default settings for the toolbar manager's appearance. Me.UltraToolbarsManager1.Appearance.BackColor = SystemColors.ActiveCaption Me.UltraToolbarsManager1.Appearance.BackColor2 = SystemColors.InactiveCaption Me.UltraToolbarsManager1.Appearance.BackGradientStyle = GradientStyle.HorizontalBump '' Create some named appearances we can use throughout our code. 'Me.UltraToolbarsManager1.Appearances.Add("StandardMenus") 'Me.UltraToolbarsManager1.Appearances("StandardMenus").BackColor = Color.LightBlue 'Me.UltraToolbarsManager1.Appearances("StandardMenus").ForeColor = Color.DarkBlue '' Setup the toolbar manager to place its toolbars on the form. We do this by setting '' the DockWithinContainer property of the toolbars manager. Me.UltraToolbarsManager1.DockWithinContainer = Me '' Specify a value for floating toolbar fade delay (in illiseconds) which determines the '' delay before a floating toolbar is faded to 20% opacity. Me.UltraToolbarsManager1.FloatingToolbarFadeDelay = 500 '' Set the imagelists to use. ' Me.UltraToolbarsManager1.ImageListLarge = Me.ilLarge 'Me.UltraToolbarsManager1.ImageListSmall = Me.ilSmall '' Specify a size value for small images (defaults to 16x16). 'Me.UltraToolbarsManager1.ImageSizeSmall = New Size(24, 24) '' Specify a size value for large images (defaults to 32x32). 'Me.UltraToolbarsManager1.ImageSizeLarge = New Size(48, 48) '' Specify a color that should be interptreted as 'transparent' when tool images '' are displayed. Me.UltraToolbarsManager1.ImageTransparentColor = Color.Magenta '' Lock the toolbars so they cannot be moved. This also prevents the grab handles '' from being displayed. Me.UltraToolbarsManager1.LockToolbars = True '' Prevent toolbars and menus in this toolbars manager from being merged with our '' MDI parent's toolbars and menus. This only has meaning when the form on which '' the toolbars manager has been placed is an MDI child form i.e., has had its MDI '' parent property set. 'Me.UltraToolbarsManager1.MdiMergeable = True '' Enable random menu animations. Me.UltraToolbarsManager1.MenuAnimationStyle = MenuAnimationStyle.Fade '' Specify some settings that will be applied to all menus. (Note: These settings '' can be overridden for specific menus by accessing the Settings object on '' the associated PopupMenuTool objects) Me.UltraToolbarsManager1.MenuSettings.Appearance.BackColor = Color.AliceBlue '' Show a vertical size strip for all menus. Me.UltraToolbarsManager1.MenuSettings.IsSideStripVisible = DefaultableBoolean.False '' Display all menus as toolbars. 'Me.UltraToolbarsManager1.MenuSettings.PopupStyle = PopupStyle.Menu '' Display a vertical side strip with the company name on all menus. 'Me.UltraToolbarsManager1.MenuSettings.SideStripText = "Chevron" '' Show font names in font. 'Me.UltraToolbarsManager1.ShowFontNamesInFont = True '' Specify a delay value (in milliseconds) for showing full menus when personalized menus are active '' (i.e., the AlwaysShowFullMenus propery is set to false) Me.UltraToolbarsManager1.ShowFullMenusDelay = 500 '' Don't show shadows under menus. Me.UltraToolbarsManager1.ShowMenuShadows = DefaultableBoolean.False '' Don't show the quick customize tool on toolbars. 'Me.UltraToolbarsManager1.ShowQuickCustomizeButton = False '' Show shortcuts in tooltips Me.UltraToolbarsManager1.ShowShortcutsInToolTips = True '' Show tooltips when the mouse hovers over a tool. 'Me.UltraToolbarsManager1.ShowToolTips = False '' Set the style of the toolbars and menus. Me.UltraToolbarsManager1.Style = ToolbarStyle.Office2010 '' Specify some settings that will be applied to all toolbars. (Note: These settings '' can be overridden for specific toolbars by accessing the Settings object on '' the associated UltraToolbar objects) '' Don't allow toolbars to dock to the left or right. 'Me.UltraToolbarsManager1.ToolbarSettings.AllowDockLeft = DefaultableBoolean.False 'Me.UltraToolbarsManager1.ToolbarSettings.AllowDockRight = DefaultableBoolean.False 'Me.UltraToolbarsManager1.ToolbarSettings.AllowDockBottom = DefaultableBoolean.False 'Me.UltraToolbarsManager1.ToolbarSettings.AllowDockTop = DefaultableBoolean.Default '' Don't allow toolbars to be customized. Me.UltraToolbarsManager1.ToolbarSettings.AllowCustomize = DefaultableBoolean.False '' Show all toolbar button captions below the button's image. Me.UltraToolbarsManager1.ToolbarSettings.CaptionPlacement = TextPlacement.BelowImage '' Increase the spacing between toolbar tools to 10 pixels. Me.UltraToolbarsManager1.ToolbarSettings.ToolSpacing = 1 '' Use large images on toolbars ans menus. 'Me.UltraToolbarsManager1.UseLargeImagesOnToolbar = True 'Me.UltraToolbarsManager1.UseLargeImagesOnMenu = True Me.UltraToolbarsManager1.ShowQuickCustomizeButton = False Me.UltraToolbarsManager1.ShowShortcutsInToolTips = False Me.UltraToolbarsManager1.ShowToolTips = False '=================================================================== ' Show the Ribbon Me.UltraToolbarsManager1.Ribbon.Visible = True ' Set the ribbon caption 'Me.UltraToolbarsManager1.Ribbon.Caption = "This is the ribbon caption when the form is active" 'Me.UltraToolbarsManager1.Ribbon.CaptionInactive = "This is the ribbon caption when the form is inactive" ' Set the Ribbon IsMinimized to false Me.UltraToolbarsManager1.Ribbon.IsMinimized = False End Sub End Class