home *** CD-ROM | disk | FTP | other *** search
- Public Class ExtenderForm
- Inherits System.Windows.Forms.Form
-
- #Region " Windows Form Designer generated code "
-
- Public Sub New()
- MyBase.New()
-
- 'This call is required by the Windows Form Designer.
- InitializeComponent()
-
- 'Add any initialization after the InitializeComponent() call
-
- End Sub
-
- 'Form overrides dispose to clean up the component list.
- Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing Then
- If Not (components Is Nothing) Then
- components.Dispose()
- End If
- End If
- MyBase.Dispose(disposing)
- End Sub
- Friend WithEvents cboRole As System.Windows.Forms.ComboBox
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
- Friend WithEvents Label3 As System.Windows.Forms.Label
- Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
- Friend WithEvents Label4 As System.Windows.Forms.Label
- Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
- Friend WithEvents Label5 As System.Windows.Forms.Label
- Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
- Friend WithEvents UserPropExtender1 As CustomControlDemo.UserPropExtender
-
- 'Required by the Windows Form Designer
- Private components As System.ComponentModel.Container
-
- 'NOTE: The following procedure is required by the Windows Form Designer
- 'It can be modified using the Windows Form Designer.
- 'Do not modify it using the code editor.
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.TextBox1 = New System.Windows.Forms.TextBox()
- Me.Label4 = New System.Windows.Forms.Label()
- Me.Label5 = New System.Windows.Forms.Label()
- Me.TextBox4 = New System.Windows.Forms.TextBox()
- Me.UserPropExtender1 = New CustomControlDemo.UserPropExtender()
- Me.Label1 = New System.Windows.Forms.Label()
- Me.cboRole = New System.Windows.Forms.ComboBox()
- Me.Label2 = New System.Windows.Forms.Label()
- Me.Label3 = New System.Windows.Forms.Label()
- Me.TextBox2 = New System.Windows.Forms.TextBox()
- Me.TextBox3 = New System.Windows.Forms.TextBox()
- Me.SuspendLayout()
- '
- 'TextBox1
- '
- Me.TextBox1.Location = New System.Drawing.Point(24, 112)
- Me.TextBox1.Name = "TextBox1"
- Me.TextBox1.Size = New System.Drawing.Size(296, 24)
- Me.TextBox1.TabIndex = 3
- Me.TextBox1.Text = "TextBox1"
- Me.UserPropExtender1.SetUserRole(Me.TextBox1, "")
- '
- 'Label4
- '
- Me.Label4.Location = New System.Drawing.Point(24, 232)
- Me.Label4.Name = "Label4"
- Me.Label4.Size = New System.Drawing.Size(288, 24)
- Me.Label4.TabIndex = 2
- Me.Label4.Text = "This field is visible only to Accountants"
- Me.UserPropExtender1.SetUserRole(Me.Label4, "")
- '
- 'Label5
- '
- Me.Label5.Location = New System.Drawing.Point(24, 304)
- Me.Label5.Name = "Label5"
- Me.Label5.Size = New System.Drawing.Size(280, 32)
- Me.Label5.TabIndex = 2
- Me.Label5.Text = "This field is visible to Accountant and TechSupport roles"
- Me.UserPropExtender1.SetUserRole(Me.Label5, "")
- '
- 'TextBox4
- '
- Me.TextBox4.Location = New System.Drawing.Point(24, 344)
- Me.TextBox4.Name = "TextBox4"
- Me.TextBox4.Size = New System.Drawing.Size(296, 24)
- Me.TextBox4.TabIndex = 3
- Me.TextBox4.Text = "TextBox4"
- Me.UserPropExtender1.SetUserRole(Me.TextBox4, "Accountant;TechSupport")
- '
- 'UserPropExtender1
- '
- Me.UserPropExtender1.CurrentUserRole = Nothing
- '
- 'Label1
- '
- Me.Label1.Location = New System.Drawing.Point(24, 8)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(192, 24)
- Me.Label1.TabIndex = 1
- Me.Label1.Text = "Select current user's role"
- Me.UserPropExtender1.SetUserRole(Me.Label1, "")
- '
- 'cboRole
- '
- Me.cboRole.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
- Me.cboRole.DropDownWidth = 184
- Me.cboRole.Items.AddRange(New Object() {"(unknown)", "Manager", "Accountant", "TechSupport"})
- Me.cboRole.Location = New System.Drawing.Point(24, 32)
- Me.cboRole.Name = "cboRole"
- Me.cboRole.Size = New System.Drawing.Size(184, 26)
- Me.cboRole.TabIndex = 0
- Me.UserPropExtender1.SetUserRole(Me.cboRole, "")
- '
- 'Label2
- '
- Me.Label2.Location = New System.Drawing.Point(24, 88)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(288, 24)
- Me.Label2.TabIndex = 2
- Me.Label2.Text = "This field is always visible"
- Me.UserPropExtender1.SetUserRole(Me.Label2, "")
- '
- 'Label3
- '
- Me.Label3.Location = New System.Drawing.Point(24, 160)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(288, 24)
- Me.Label3.TabIndex = 2
- Me.Label3.Text = "This field is visible only to Managers"
- Me.UserPropExtender1.SetUserRole(Me.Label3, "")
- '
- 'TextBox2
- '
- Me.TextBox2.Location = New System.Drawing.Point(24, 184)
- Me.TextBox2.Name = "TextBox2"
- Me.TextBox2.Size = New System.Drawing.Size(296, 24)
- Me.TextBox2.TabIndex = 3
- Me.TextBox2.Text = "TextBox2"
- Me.UserPropExtender1.SetUserRole(Me.TextBox2, "Manager")
- '
- 'TextBox3
- '
- Me.TextBox3.Location = New System.Drawing.Point(24, 256)
- Me.TextBox3.Name = "TextBox3"
- Me.TextBox3.Size = New System.Drawing.Size(296, 24)
- Me.TextBox3.TabIndex = 3
- Me.TextBox3.Text = "TextBox3"
- Me.UserPropExtender1.SetUserRole(Me.TextBox3, "Accountant")
- '
- 'Form1
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(7, 17)
- Me.ClientSize = New System.Drawing.Size(416, 381)
- Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label5, Me.TextBox4, Me.Label4, Me.TextBox3, Me.Label3, Me.TextBox2, Me.TextBox1, Me.Label2, Me.Label1, Me.cboRole})
- Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.Name = "Form1"
- Me.Text = "Extender provider "
- Me.UserPropExtender1.SetUserRole(Me, "")
- Me.ResumeLayout(False)
-
- End Sub
-
- #End Region
-
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- cboRole.SelectedIndex = 0
- End Sub
-
- Private Sub cboRole_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboRole.SelectedIndexChanged
- If cboRole.SelectedIndex = 0 Then
- UserPropExtender1.CurrentUserRole = ""
- Else
- UserPropExtender1.CurrentUserRole = cboRole.Text
- End If
-
- End Sub
- End Class
-