home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Programare / netxp / netxp.exe / Samples / VB / Bars / TestPopup.vb < prev   
Encoding:
Text File  |  2004-04-09  |  4.9 KB  |  121 lines

  1. Imports System
  2. Imports System.Drawing
  3. Imports System.Collections
  4. Imports System.ComponentModel
  5. Imports System.Windows.Forms
  6. Imports NETXP.Controls.Bars
  7.  
  8. Namespace Bars
  9.     Public Class TestPopup
  10.      Inherits NETXP.Library.PopupForm
  11.         Private commandBar1 As NETXP.Controls.Bars.CommandBar
  12.         Private commandBarButtonItem1 As NETXP.Controls.Bars.CommandBarButtonItem
  13.         Private commandBarSeparatorItem1 As NETXP.Controls.Bars.CommandBarSeparatorItem
  14.         Private WithEvents commandBarButtonItem2 As NETXP.Controls.Bars.CommandBarButtonItem
  15.         Private commandBarButtonItem3 As NETXP.Controls.Bars.CommandBarButtonItem
  16.         Private commandBarButtonItem4 As NETXP.Controls.Bars.CommandBarButtonItem
  17.         Private toolTip1 As System.Windows.Forms.ToolTip
  18.         Private components As System.ComponentModel.IContainer
  19.  
  20.         Public Sub New()
  21.             '
  22.             ' Required for Windows Form Designer support
  23.             '
  24.             InitializeComponent()
  25.  
  26.             AddHandler Me.commandBarButtonItem1.Click, AddressOf commandBarButtonItem1_Click
  27.         End Sub
  28.  
  29.         Public Sub SetManager(bm as CommandBarManager)
  30.             Me.commandBar1.Renderer = bm.Renderer
  31.         End Sub
  32.  
  33.         protected overrides sub Dispose(disposing as Boolean)
  34.             if disposing then
  35.                 If Not components Is Nothing Then
  36.                     components.Dispose()
  37.                 End If
  38.             End If
  39.             MyBase.Dispose(disposing)
  40.         end sub
  41.  
  42.         #region "Windows Form Designer generated code"
  43.         private sub InitializeComponent()
  44.             Me.components = New System.ComponentModel.Container()
  45.             Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(TestPopup))
  46.             Me.commandBar1 = New NETXP.Controls.Bars.CommandBar()
  47.             Me.commandBarButtonItem1 = New NETXP.Controls.Bars.CommandBarButtonItem()
  48.             Me.commandBarSeparatorItem1 = New NETXP.Controls.Bars.CommandBarSeparatorItem()
  49.             Me.commandBarButtonItem2 = New NETXP.Controls.Bars.CommandBarButtonItem()
  50.             Me.commandBarButtonItem3 = New NETXP.Controls.Bars.CommandBarButtonItem()
  51.             Me.commandBarButtonItem4 = New NETXP.Controls.Bars.CommandBarButtonItem()
  52.             Me.toolTip1 = New System.Windows.Forms.ToolTip(Me.components)
  53.             CType((Me.commandBar1), System.ComponentModel.ISupportInitialize).BeginInit()
  54.             Me.SuspendLayout()
  55.             ' 
  56.             ' commandBar1
  57.             ' 
  58.             Me.commandBar1.AutoFocus = False
  59.             Me.commandBar1.BackColor = System.Drawing.Color.Transparent
  60.             Me.commandBar1.Cursor = System.Windows.Forms.Cursors.Default
  61.             Me.commandBar1.CustomBackground = True
  62.             Me.commandBar1.CustomizeText = "&Customize Toolbar..."
  63.             Me.commandBar1.Dock = System.Windows.Forms.DockStyle.Top
  64.             Me.commandBar1.ID = 548
  65.             Me.commandBar1.Items.AddRange(New NETXP.Controls.Bars.CommandBarItem() {Me.commandBarButtonItem1, Me.commandBarSeparatorItem1, Me.commandBarButtonItem2})
  66.             Me.commandBar1.Location = New System.Drawing.Point(0, 0)
  67.             Me.commandBar1.Margins.Bottom = 1
  68.             Me.commandBar1.Margins.Left = 1
  69.             Me.commandBar1.Margins.Right = 1
  70.             Me.commandBar1.Margins.Top = 1
  71.             Me.commandBar1.Name = "commandBar1"
  72.             Me.commandBar1.Size = New System.Drawing.Size(168, 41)
  73.             Me.commandBar1.TabIndex = 0
  74.             Me.commandBar1.TabStop = False
  75.             Me.commandBar1.Text = "commandBar1"
  76.             ' 
  77.             ' commandBarButtonItem1
  78.             ' 
  79.             Me.commandBarButtonItem1.Image = (CType((resources.GetObject("commandBarButtonItem1.Image")), System.Drawing.Image))
  80.             Me.commandBarButtonItem1.ShowText = True
  81.             Me.commandBarButtonItem1.Text = "Test"
  82.             ' 
  83.             ' commandBarButtonItem2
  84.             ' 
  85.             Me.commandBarButtonItem2.Image = (CType((resources.GetObject("commandBarButtonItem2.Image")), System.Drawing.Image))
  86.             Me.commandBarButtonItem2.Items.AddRange(New NETXP.Controls.Bars.CommandBarItem() {Me.commandBarButtonItem3, Me.commandBarButtonItem4})
  87.             Me.commandBarButtonItem2.Text = "Abc"
  88.             ' 
  89.             ' commandBarButtonItem3
  90.             ' 
  91.             Me.commandBarButtonItem3.Text = "Test1"
  92.             ' 
  93.             ' commandBarButtonItem4
  94.             ' 
  95.             Me.commandBarButtonItem4.Text = "Test2"
  96.             ' 
  97.             ' TestPopup
  98.             ' 
  99.             Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  100.             Me.BackColor = System.Drawing.SystemColors.Window
  101.             Me.ClientSize = New System.Drawing.Size(168, 96)
  102.             Me.Controls.Add(Me.commandBar1)
  103.             Me.Name = "TestPopup"
  104.             CType((Me.commandBar1), System.ComponentModel.ISupportInitialize).EndInit()
  105.             Me.ResumeLayout(False)
  106.  
  107.         end sub
  108.         #End Region
  109.  
  110.         Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
  111.             e.Graphics.DrawRectangle(SystemPens.WindowFrame, 0, 0, Width - 1, Height - 1)
  112.         End Sub
  113.  
  114.         Private Sub commandBarButtonItem1_Click(ByVal sender As Object, ByVal e As EventArgs)
  115.             Close()
  116.         End Sub
  117.  
  118.         Private Sub commandBarButtonItem2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles commandBarButtonItem2.Click
  119.         End Sub
  120.     End Class
  121. End Namespace