Click here to Skip to main content
15,892,059 members
Articles / Multimedia / GDI+

Rich Design Time Editing with UITypeEditors (VB.NET)

Rate me:
Please Sign up or sign in to vote.
4.98/5 (63 votes)
18 Jan 2012CPOL14 min read 167.9K   4.5K   170  
How to use UITypeEditors, Smart Tags, ControlDesigner Verbs, and Expandable Properties to make design-time editing easier.
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class dlgFocalPoints
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    '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()
        Dim DesignerRectTracker33 As UITypeEditorDemo.DesignerRectTracker = New UITypeEditorDemo.DesignerRectTracker
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(dlgFocalPoints))
        Dim DesignerRectTracker34 As UITypeEditorDemo.DesignerRectTracker = New UITypeEditorDemo.DesignerRectTracker
        Me.butApply = New System.Windows.Forms.Button
        Me.tbarFocalX = New System.Windows.Forms.TrackBar
        Me.tbarFocalY = New System.Windows.Forms.TrackBar
        Me.panShapeHolder = New System.Windows.Forms.Panel
        Me.TheShape = New UITypeEditorDemo.Shape
        Me.lblFy = New System.Windows.Forms.Label
        Me.lblFx = New System.Windows.Forms.Label
        Me.lblCx = New System.Windows.Forms.Label
        Me.lblCy = New System.Windows.Forms.Label
        Me.butCancel = New System.Windows.Forms.Button
        Me.Label1 = New System.Windows.Forms.Label
        CType(Me.tbarFocalX, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.tbarFocalY, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.panShapeHolder.SuspendLayout()
        Me.SuspendLayout()
        '
        'butApply
        '
        Me.butApply.Anchor = System.Windows.Forms.AnchorStyles.None
        Me.butApply.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.butApply.Location = New System.Drawing.Point(106, 323)
        Me.butApply.Name = "butApply"
        Me.butApply.Size = New System.Drawing.Size(67, 23)
        Me.butApply.TabIndex = 0
        Me.butApply.Text = "Apply"
        '
        'tbarFocalX
        '
        Me.tbarFocalX.LargeChange = 10
        Me.tbarFocalX.Location = New System.Drawing.Point(12, 236)
        Me.tbarFocalX.Maximum = 1000
        Me.tbarFocalX.Name = "tbarFocalX"
        Me.tbarFocalX.Size = New System.Drawing.Size(200, 45)
        Me.tbarFocalX.TabIndex = 3
        Me.tbarFocalX.TickFrequency = 50
        Me.tbarFocalX.TickStyle = System.Windows.Forms.TickStyle.TopLeft
        Me.tbarFocalX.Value = 500
        '
        'tbarFocalY
        '
        Me.tbarFocalY.Location = New System.Drawing.Point(218, 30)
        Me.tbarFocalY.Maximum = 1000
        Me.tbarFocalY.Name = "tbarFocalY"
        Me.tbarFocalY.Orientation = System.Windows.Forms.Orientation.Vertical
        Me.tbarFocalY.Size = New System.Drawing.Size(45, 200)
        Me.tbarFocalY.TabIndex = 3
        Me.tbarFocalY.TickFrequency = 50
        Me.tbarFocalY.TickStyle = System.Windows.Forms.TickStyle.TopLeft
        Me.tbarFocalY.Value = 500
        '
        'panShapeHolder
        '
        Me.panShapeHolder.Controls.Add(Me.TheShape)
        Me.panShapeHolder.Location = New System.Drawing.Point(12, 30)
        Me.panShapeHolder.Name = "panShapeHolder"
        Me.panShapeHolder.Size = New System.Drawing.Size(200, 200)
        Me.panShapeHolder.TabIndex = 4
        '
        'TheShape
        '
        DesignerRectTracker33.IsActive = False
        DesignerRectTracker33.TrackerRectangle = CType(resources.GetObject("DesignerRectTracker33.TrackerRectangle"), System.Drawing.RectangleF)
        Me.TheShape.CenterPtTracker = DesignerRectTracker33
        Me.TheShape.ColorFillSolid = System.Drawing.SystemColors.Control
        DesignerRectTracker34.IsActive = False
        DesignerRectTracker34.TrackerRectangle = CType(resources.GetObject("DesignerRectTracker34.TrackerRectangle"), System.Drawing.RectangleF)
        Me.TheShape.FocusPtTracker = DesignerRectTracker34
        Me.TheShape.Location = New System.Drawing.Point(0, 0)
        Me.TheShape.Name = "TheShape"
        Me.TheShape.Size = New System.Drawing.Size(200, 200)
        Me.TheShape.TabIndex = 1
        '
        'lblFy
        '
        Me.lblFy.Location = New System.Drawing.Point(220, 226)
        Me.lblFy.Name = "lblFy"
        Me.lblFy.Size = New System.Drawing.Size(37, 17)
        Me.lblFy.TabIndex = 5
        Me.lblFy.Text = "0.5"
        Me.lblFy.TextAlign = System.Drawing.ContentAlignment.TopCenter
        '
        'lblFx
        '
        Me.lblFx.Location = New System.Drawing.Point(206, 248)
        Me.lblFx.Name = "lblFx"
        Me.lblFx.Size = New System.Drawing.Size(37, 17)
        Me.lblFx.TabIndex = 5
        Me.lblFx.Text = "0.5"
        Me.lblFx.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'lblCx
        '
        Me.lblCx.AutoSize = True
        Me.lblCx.Location = New System.Drawing.Point(14, 290)
        Me.lblCx.Name = "lblCx"
        Me.lblCx.Size = New System.Drawing.Size(48, 13)
        Me.lblCx.TabIndex = 6
        Me.lblCx.Text = "Center X"
        '
        'lblCy
        '
        Me.lblCy.AutoSize = True
        Me.lblCy.Location = New System.Drawing.Point(132, 290)
        Me.lblCy.Name = "lblCy"
        Me.lblCy.Size = New System.Drawing.Size(48, 13)
        Me.lblCy.TabIndex = 7
        Me.lblCy.Text = "Center Y"
        '
        'butCancel
        '
        Me.butCancel.Anchor = System.Windows.Forms.AnchorStyles.None
        Me.butCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.butCancel.Location = New System.Drawing.Point(179, 323)
        Me.butCancel.Name = "butCancel"
        Me.butCancel.Size = New System.Drawing.Size(67, 23)
        Me.butCancel.TabIndex = 0
        Me.butCancel.Text = "Cancel"
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(12, 3)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(234, 19)
        Me.Label1.TabIndex = 8
        Me.Label1.Text = "Drag the CenterPoint with the mouse"
        Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'dlgFocalPoints
        '
        Me.AcceptButton = Me.butApply
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(258, 352)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.butCancel)
        Me.Controls.Add(Me.butApply)
        Me.Controls.Add(Me.lblCy)
        Me.Controls.Add(Me.lblCx)
        Me.Controls.Add(Me.lblFx)
        Me.Controls.Add(Me.lblFy)
        Me.Controls.Add(Me.panShapeHolder)
        Me.Controls.Add(Me.tbarFocalY)
        Me.Controls.Add(Me.tbarFocalX)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "dlgFocalPoints"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
        Me.Text = "Adjust CenterPoint & Focus Scales"
        CType(Me.tbarFocalX, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.tbarFocalY, System.ComponentModel.ISupportInitialize).EndInit()
        Me.panShapeHolder.ResumeLayout(False)
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents butApply As System.Windows.Forms.Button
    Friend WithEvents TheShape As UITypeEditorDemo.Shape
    Friend WithEvents tbarFocalX As System.Windows.Forms.TrackBar
    Friend WithEvents tbarFocalY As System.Windows.Forms.TrackBar
    Friend WithEvents panShapeHolder As System.Windows.Forms.Panel
    Friend WithEvents lblFy As System.Windows.Forms.Label
    Friend WithEvents lblFx As System.Windows.Forms.Label
    Friend WithEvents lblCx As System.Windows.Forms.Label
    Friend WithEvents lblCy As System.Windows.Forms.Label
    Friend WithEvents butCancel As System.Windows.Forms.Button
    Friend WithEvents Label1 As System.Windows.Forms.Label

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
I first got hooked on programing with the TI994A. After it finally lost all support I reluctantly moved to the Apple IIe. Thank You BeagleBros for getting me through. I wrote programs for my Scuba buisness during this time. Currently I am a Database manager and software developer. I started with VBA and VB6 and now having fun with VB.NET/WPF/C#...

Comments and Discussions