Mini Kabibi Habibi

Current Path : C:/Users/Public/Documents/DXperience 13.1 Demos/WinForms/VB/EditorsTutorials/
Upload File :
Current File : C:/Users/Public/Documents/DXperience 13.1 Demos/WinForms/VB/EditorsTutorials/FrmMainXtraEditors.vb

Imports Microsoft.VisualBasic
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
Imports DevExpress.XtraBars

Namespace DevExpress.Tutorials.XtraEditors
	Partial Public Class FrmMainXtraEditors
		Inherits DevExpress.Tutorials.FrmMainTreeViewReg
		Public Sub New()
			MyBase.New()
			InitializeComponent()
			AddHandler defaultLookAndFeel.LookAndFeel.StyleChanged, AddressOf LookAndFeel_StyleChanged
		End Sub
		Friend ReadOnly Property Manager() As BarManager
			Get
				Return barManager1
			End Get
		End Property
		Private Sub LookAndFeel_StyleChanged(ByVal sender As Object, ByVal e As EventArgs)
			tvNavigation.ExpandAll()
		End Sub

        Private languageDir As String = "VB\"

		Private Function GetImageFromResources(ByVal name As String) As Image
			Try
                Dim str As System.IO.Stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(name)
				Return Image.FromStream(str)
			Catch
				Return Nothing
			End Try
		End Function
		Private Function GetXmlFileByName(ByVal name As String) As String
			Return "Data\Tutorials\XtraEditors\" & name
		End Function

		Private Function GetFileNameByName(ByVal name As String) As String
			Dim fileNames() As String = name.Split(New Char() { ";"c })
			Dim codePath As String = "EditorsTutorials\Modules\"
			Dim codeFile As String = DevExpress.Utils.FilesHelper.FindingFileName(Application.StartupPath, codePath & fileNames(0), False)
			If codeFile = "" Then
			codePath = languageDir & codePath
			End If
			Dim resultString As String = String.Empty
			For Each fileName As String In fileNames
				resultString &= ";" & codePath & fileName
			Next fileName
			Return resultString.Substring(1)
		End Function
		Protected Overrides Sub InitModuleInformation()
			Me.imageListTreeView.Images.Add(GetImageFromResources("category.gif"), Color.Magenta)
			AddModuleInfo(0, -1, "Welcome", String.Empty, GetType(ModuleWelcome))
			AddModuleInfo(1, -1, "No text box", String.Empty, Nothing)
            AddModuleInfo(2, 1, "CheckEdit", GetImageFromResources("check_edit.gif"), GetType(ModuleCheckEdit), "This tutorial demonstrates a CheckEdit editor that has checked, unchecked and, optionally, grayed states. It's most commonly used to edit Boolean values.", GetXmlFileByName("checkEdit.xml"), GetFileNameByName("ModuleCheckEdit.vb"))
            AddModuleInfo(3, 1, "ProgressBar (updated)", GetImageFromResources("progressbar.gif"), GetType(ModuleProgressBar), "This tutorial demonstrates a ProgressBarControl. It's most commonly used to indicate the progress of a lengthy operation.", GetXmlFileByName("progressBar.xml"), GetFileNameByName("ModuleProgressBar.vb"))
            AddModuleInfo(4, 1, "RadioGroup", GetImageFromResources("radio_group.gif"), GetType(ModuleRadioGroup), "This tutorial demonstrates a RadioGroup editor which provides a group of radio buttons. It allows a user to select one of several options.", GetXmlFileByName("radioGroup.xml"), GetFileNameByName("ModuleRadioGroup.vb"))
            AddModuleInfo(5, 1, "PictureEdit", GetImageFromResources("picture_edit.gif"), GetType(ModulePictureEdit), "This tutorial demonstrates a PictureEdit editor which is used to display images stored as a bitmap, metafile, icon, JPEG, GIF or PNG.", GetXmlFileByName("pictureEdit.xml"), GetFileNameByName("ModulePictureEdit.vb"))
			AddModuleInfo(6, -1, "Text Box Editors", String.Empty, Nothing)
            AddModuleInfo(8, 6, "TextEdit", GetImageFromResources("text_edit.gif"), GetType(ModuleTextEdit), "This tutorial demonstrates a TextEdit � a single-line text editor.", GetXmlFileByName("textedit.xml"), GetFileNameByName("ModuleTextEdit.vb"))
            AddModuleInfo(11, 6, "ButtonEdit", GetImageFromResources("button_edit.gif"), GetType(ModuleButtonEdit), "This tutorial demonstrates a ButtonEdit editor which lets you display an unlimited number of buttons within the edit box.", GetXmlFileByName("buttonedit.xml"), GetFileNameByName("ModuleButtonEdit.vb;ButtonProperties.vb"))
            AddModuleInfo(12, 6, "HyperLinkEdit", GetImageFromResources("hyperlink_edit.gif"), GetType(ModuleHyperLinkEdit), "This tutorial demonstrates a HyperLinkEdit editor which lets you edit hyperlinks and navigate to their targets.", GetXmlFileByName("hyperlinkedit.xml"), GetFileNameByName("ModuleHyperLinkEdit.vb"))
            AddModuleInfo(13, 6, "MemoEdit", GetImageFromResources("memo_edit.gif"), GetType(ModuleMemoEdit), "This tutorial demonstrates a MemoEdit editor which enables multi-line text to be displayed and edited.", GetXmlFileByName("memoedit.xml"), GetFileNameByName("ModuleMemoEdit.vb"))
            AddModuleInfo(10, -1, "Spin Editors", String.Empty, Nothing)
            AddModuleInfo(7, 10, "SpinEdit", GetImageFromResources("spin_edit.gif"), GetType(ModuleSpinEdit), "This tutorial demonstrates a SpinEdit editor which allows numeric values to be edited using spin buttons.", GetXmlFileByName("spinedit.xml"), GetFileNameByName("ModuleSpinEdit.vb"))
            AddModuleInfo(9, 10, "TimeEdit (updated)", GetImageFromResources("time_edit.gif"), GetType(ModuleTimeEdit), "This tutorial demonstrates a TimeEdit editor which allows time values to be edited using spin buttons.", GetXmlFileByName("timeedit.xml"), GetFileNameByName("ModuleTimeEdit.vb"))
            AddModuleInfo(14, -1, "Popup Editors", String.Empty, Nothing)
            AddModuleInfo(15, 14, "CalcEdit", GetImageFromResources("calc_edit.gif"), GetType(ModuleCalcEdit), "This tutorial demonstrates a CalcEdit editor which provides a dropdown calculator. Using the dropdown calculator, you can perform basic calculations such as addition, multiplication, getting the inverse of a number and working with a memory register etc.", GetXmlFileByName("calcedit.xml"), GetFileNameByName("ModuleCalcEdit.vb"))
            AddModuleInfo(16, 14, "ColorEdit", GetImageFromResources("color_edit.gif"), GetType(ModuleColorEdit), "This tutorial demonstrates a ColorEdit editor which allows you to select a color from the dropdown window. The dropdown contains three tabbed pages displaying predefined custom, web and system colors.", GetXmlFileByName("coloredit.xml"), GetFileNameByName("ModuleColorEdit.vb"))
            AddModuleInfo(38, 14, "ColorPickEdit", GetImageFromResources("colorpick_edit.gif"), GetType(ModuleColorPickEdit), "This tutorial demonstrates a ColorEdit editor which allows you to select a color from the dropdown window. The dropdown contains three tabbed pages displaying predefined custom, web and system colors.", GetXmlFileByName("coloredit.xml"), GetFileNameByName("ModuleColorPickEdit.vb"))
            AddModuleInfo(17, 14, "ComboBoxEdit", GetImageFromResources("combobox_edit.gif"), GetType(ModuleComboBoxEdit), "This tutorial demonstrates a ComboBoxEdit editor which allows you to select the predefined items from the dropdown list.", GetXmlFileByName("comboboxedit.xml"), GetFileNameByName("ModuleComboBoxEdit.vb"))
            AddModuleInfo(18, 14, "DateEdit (updated)", GetImageFromResources("date_edit.gif"), GetType(ModuleDateEdit), "This tutorial demonstrates a DateEdit editor which allows date/time values to be edited using a dropdown calendar.", GetXmlFileByName("dateedit.xml"), GetFileNameByName("ModuleDateEdit.vb"))
            AddModuleInfo(19, 14, "ImageComboBoxEdit", GetImageFromResources("imagecombobox_edit.gif"), GetType(ModuleImageComboBoxEdit), "This tutorial demonstrates an ImageComboBoxEdit editor. This editor represents a combo box editor whose items can display custom images.", GetXmlFileByName("imagecomboboxedit.xml"), GetFileNameByName("ModuleImageComboBoxEdit.vb"))
            AddModuleInfo(20, 14, "ImageEdit", GetImageFromResources("image_edit.gif"), GetType(ModuleImageEdit), "This tutorial demonstrates an ImageEdit editor which displays images (bitmap, metafile, icon, JPEG, GIF or PNG file) in its popup window.", GetXmlFileByName("imageedit.xml"), GetFileNameByName("ModuleImageEdit.vb"))
            AddModuleInfo(21, 14, "LookUpEdit", GetImageFromResources("lookup_edit.gif"), GetType(ModuleLookUpEdit), "This tutorial demonstrates a LookUpEdit editor which is used to display a multi-column record list from an associated data source.", GetXmlFileByName("lookupedit.xml"), GetFileNameByName("ModuleLookUpEdit.vb;LookUpProperties.vb;Contacts.vb"))
            AddModuleInfo(22, 14, "MemoExEdit", GetImageFromResources("memoex_edit.gif"), GetType(ModuleMemoExEdit), "This tutorial demonstrates a MemoExEdit editor which allows multi-line text to be edited in its popup window.", GetXmlFileByName("memoeditex.xml"), GetFileNameByName("ModuleMemoExEdit.vb"))
            AddModuleInfo(23, 14, "MRUEdit", GetImageFromResources("mru_edit.gif"), GetType(ModuleMRUEdit), "This tutorial demonstrates a MRUEdit editor which allows the most recently entered value to be chosen from the dropdown list.", GetXmlFileByName("mruedit.xml"), GetFileNameByName("ModuleMRUEdit.vb"))
            AddModuleInfo(24, 14, "PopupContainerEdit", GetImageFromResources("popupcontainer_edit.gif"), GetType(ModulePopupContainerEdit), "This tutorial demonstrates a PopupContainerEdit editor which is used to display custom controls within its popup window. You must additionally create a PopupContainerControl control which will represent the popup window. You can place any control onto the popup container control. To display the control's contents within an editor's popup window, you should set the editor's PopupControl property to this control.", GetXmlFileByName("popupcontaineredit.xml"), GetFileNameByName("ModulePopupContainerEdit.vb"))
            AddModuleInfo(25, -1, "Controls", String.Empty, Nothing)
            AddModuleInfo(37, 25, "DropDown Button", GetImageFromResources("dropdownbutton.gif"), GetType(ModuleDropDownButton), "This tutorial demonstrates the DropDownButton control - a button that can be associated with a popup control or a context menu. You can invoke the associated control by clicking the button's drop-down arrow, or the button itself (if the arrow is hidden).", GetXmlFileByName("dropdownbutton.xml"), GetFileNameByName("ModuleDropDownButton.vb"))
            AddModuleInfo(26, 25, "DataNavigator", GetImageFromResources("data_navigator.gif"), GetType(ModuleNavigator), "This tutorial demonstrates a DataNavigator control which provides a graphical interface to navigate and manipulate the records in a data source.", GetXmlFileByName("navigator.xml"), GetFileNameByName("ModuleNavigator.vb"))
            AddModuleInfo(27, 25, "MaskBox", GetImageFromResources("mask_box.gif"), GetType(ModuleMaskBox), "This tutorial demonstrates how to use masks during editing. Masks provide restricted data input as well as formatted data output. This can be useful when the entered string should match a specific format.", GetXmlFileByName("maskbox.xml"), GetFileNameByName("ModuleMaskBox.vb;MaskProperties.vb"))
            AddModuleInfo(28, 25, "ListBoxes", GetImageFromResources("list_boxes.gif"), GetType(ModuleListBox), "This tutorial demonstrates a ListBoxControl which is used to display a list of items that a user can select.", GetXmlFileByName("listbox.xml"), GetFileNameByName("ModuleListBox.vb;ListBoxProperties.vb"))
            AddModuleInfo(29, 25, "ToolTipController", GetImageFromResources("tooltipcontroller.gif"), GetType(ModuleToolTipController), "This tutorial demonstrates the functionality of the ToolTipController component which manages tooltips for controls.", GetXmlFileByName("tooltipcontroller.xml"), GetFileNameByName("ModuleToolTipController.vb;ToolTipControllerContentProperties.vb"))
            AddModuleInfo(30, 1, "Marquee Progress", GetImageFromResources("marquee_progressbar.gif"), GetType(ModuleMarqueeProgressBar), "This tutorial demonstrates a MarqueeProgressBarControl. It's most commonly used to indicate that an operation is going on by continuously scrolling a block from left to right.", GetXmlFileByName("marqueeProgressBar.xml"), GetFileNameByName("ModuleMarqueeProgressBar.vb"))
            AddModuleInfo(31, 1, "TrackBar", GetImageFromResources("trackbar.gif"), GetType(ModuleTrackBar), "This tutorial demonstrates a TrackBarControl. This is a scrollable control which is used to slide a small thumb along a continuous line.", GetXmlFileByName("trackBar.xml"), GetFileNameByName("ModuleTrackBar.vb"))
            AddModuleInfo(32, 1, "RangeTrackBar", GetImageFromResources("rangetrackbar.gif"), GetType(ModuleRangeTrackBar), "This tutorial demonstrates the RangeTrackBarControl that allows the range of values to be specified. Use the editor's Value property to specify the minimum and maximum limits of the range.", GetXmlFileByName("rangetrackBar.xml"), GetFileNameByName("ModuleRangeTrackBar.vb"))
            AddModuleInfo(33, 14, "FontEdit", GetImageFromResources("font_edit.gif"), GetType(ModuleFontEdit), "This tutorial demonstrates the FontEdit control. The editor allows an end-user to select a specific font by picking up from among all available fonts. After a font has been selected, it's added to the list, which contains the most recently used fonts, and these are listed at the top of the editor's dropdown. Practice selecting fonts and customizing the length of the MRU font list.", GetXmlFileByName("fontEdit.xml"), GetFileNameByName("ModuleFontEdit.vb"))
            AddModuleInfo(36, 14, "CheckedComboBox", GetImageFromResources("checkedcombobox_edit.gif"), GetType(ModuleCheckedComboBoxEdit), "This tutorial demonstrates the CheckedComboBoxEdit control that allows you to display and edit a set of Boolean options or bit fields in a popup window", GetXmlFileByName("checkedcomboboxEdit.xml"), GetFileNameByName("ModuleCheckedComboBoxEdit.vb"))
            AddModuleInfo(34, 1, "ZoomTrackBar", GetImageFromResources("zoomtrackbar.gif"), GetType(ModuleZoomTrackBar), "This tutorial demonstrates a ZoomTrackBarControl. This control emulates the Zoom track bar introduced in MS Office 2007. This control is appropriate for implementing a zooming bar in your applications.", GetXmlFileByName("zoomTrackBar.xml"), GetFileNameByName("ModuleZoomTrackBar.vb"))
            AddModuleInfo(35, 25, "DXValidationProvider", GetImageFromResources("validationprovider.gif"), GetType(ModuleDXValidationProvider), "This tutorial demonstrates how to perform data validation via the DXValidationProvider component. This component allows you to associate specific validation rules with editors, and perform validation manually or automatically (on leaving editors). In the example, validation rules are created and applied to editors in code. However, these can also be created at design time via the component's designer. Practice changing the editors' values to violate validation rules and see how the editors respond.", GetXmlFileByName("dxvalidationprovider.xml"), GetFileNameByName("DXValidationProvider.vb"))
            AddModuleInfo(39, 1, "SparklineEdit (new)", GetImageFromResources("sparkline_edit.gif"), GetType(ModuleSparklineEdit), "This tutorial demonstrates a SparklineEdit control. This control visualizes data in a highly condensed way thus allowing end-users to quickly understand and compare values from different sources.", GetXmlFileByName("SparklineEdit.xml"), GetFileNameByName("ModuleSparklineEdit.vb"))
            AddModuleInfo(40, 1, "ToggleSwitch (new)", GetImageFromResources("toggle_switch.gif"), GetType(ModuleToggleSwitch), "This tutorial demonstrates a ToggleSwitch editor that has on and off states.", GetXmlFileByName("toggleSwitch.xml"), GetFileNameByName("ModuleToggleSwitch.cs"))
        End Sub

		Protected Overrides Function CreateMenu(ByVal manager As DevExpress.XtraBars.BarManager, ByVal lookAndFeel As DevExpress.LookAndFeel.DefaultLookAndFeel) As DevExpress.DXperience.Demos.LookAndFeelMenu
			Return New EditorsTutorialMenu(manager, lookAndFeel, "Tutorial examples for the " & AssemblyInfo.SRAssemblyEditors)
		End Function
	End Class
End Namespace