Mini Kabibi Habibi

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

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

Namespace DevExpress.XtraBars.Demos.Tutorials
	''' <summary>
	''' Summary description for AddNewBar.
	''' </summary>
	Public Partial Class AddNewBar
		Inherits TutorialControl
		Public Sub New()
			'
			' Required for Windows Form Designer support
			'
			InitializeComponent()

			'
			' TODO: Add any constructor code after InitializeComponent call
			'
		End Sub

		'<button1>
		Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
			Dim bar As DevExpress.XtraBars.Bar = New DevExpress.XtraBars.Bar(barManager1)
			bar.DockStyle = DevExpress.XtraBars.BarDockStyle.Top
			bar.Visible = True
			Description(bar.Text & " Added")
		End Sub
		'</button1>

		'<button2>
		Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button2.Click
			Dim s As String = ""
			Dim lastBarIndex As Integer = barManager1.Bars.Count - 1
			If lastBarIndex >= 0 Then
				Dim bar As DevExpress.XtraBars.Bar = CType(barManager1.Bars(lastBarIndex), DevExpress.XtraBars.Bar)
				s = "Bar Deleted: " & bar.BarName
				bar.Dispose()
			End If
			Description(s)
		End Sub
		'</button2>

		'<button1>
		Private Sub Description(ByVal s As String)
			If (s Is Nothing) Then
				label1.Text = ""
			Else
				label1.Text = s
			End If
		End Sub
		'</button1>
	End Class
End Namespace