×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Adding Drob Box to pre-existing Form Class

Adding Drob Box to pre-existing Form Class

Adding Drob Box to pre-existing Form Class

(OP)
I've tried searching pre-existing threads as well as the web and everywhere I look this seems to be made far more complicated that it seems like it should be.

Issue:  Creating a journal program, using a samble journal for generating title block, that queries the user for part attributes, and applies them to title block.  I want it to drop a sheet size selection which will determine which template and sheet size to use, so that all of this is done automatically for the user.

Here is my form to query the user:

CODE

' ----------------------------------------------
'   The following code for the form was generated
'   using Microsoft Visual Studio .Net
' ----------------------------------------------

Public Class Form1
    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

    '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.
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents m_partNameTextBox As System.Windows.Forms.TextBox
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents m_authorNameTextBox As System.Windows.Forms.TextBox
    Friend WithEvents Label3 as System.Windows.Forms.Label
    Friend WithEvents m_revNameTextBox As System.Windows.Forms.TextBox
    Friend WithEvents Label4 as System.Windows.Forms.Label
    Friend WithEvents m_partNumberTextBox As System.Windows.Forms.TextBox
    Friend WithEvents Button1 As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.m_partNameTextBox = New System.Windows.Forms.TextBox
Me.Label2 = New System.Windows.Forms.Label
Me.m_authorNameTextBox = New System.Windows.Forms.TextBox
Me.Label3 = New System.Windows.Forms.Label
Me.m_revNameTextBox = New System.Windows.Forms.TextBox
Me.Label4 = New System.Windows.Forms.Label
Me.m_partNumberTextBox = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(16, 24)
Me.Label1.Name = "Label1"
Me.Label1.TabIndex = 0
Me.Label1.Text = "Part Name"
'
'm_partNameTextBox
'
Me.m_partNameTextBox.Location = New System.Drawing.Point(90, 24)
Me.m_partNameTextBox.Name = "m_partNameTextBox"
Me.m_partNameTextBox.Size = New System.Drawing.Size(173, 20)
Me.m_partNameTextBox.TabIndex = 1
Me.m_partNameTextBox.Text = ""
Me.m_partNameTextBox.MaxLength = 30
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(16, 56)
Me.Label2.Name = "Label2"
Me.Label2.TabIndex = 2
Me.Label2.Text = "Drafter Name"
'
'm_authorNameTextBox
'
Me.m_authorNameTextBox.Location = New System.Drawing.Point(90, 56)
Me.m_authorNameTextBox.Name = "m_authorNameTextBox"
Me.m_authorNameTextBox.Size = New System.Drawing.Size(173, 20)
Me.m_authorNameTextBox.TabIndex = 3
Me.m_authorNameTextBox.Text = ""
Me.m_authorNameTextBox.MaxLength = 30
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(16, 88)
Me.Label3.Name = "Label3"
Me.Label3.TabIndex = 4
Me.Label3.Text = "Rev Level"
'
'm_revNameTextBox
'
Me.m_revNameTextBox.Location = New System.Drawing.Point(90, 88)
Me.m_revNameTextBox.Name = "m_revNameTextBox"
Me.m_revNameTextBox.Size = New System.Drawing.Size(173, 20)
Me.m_revNameTextBox.TabIndex = 5
Me.m_revNameTextBox.Text = ""
Me.m_revNameTextBox.MaxLength = 30
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(16, 120)
Me.Label4.Name = "Label4"
Me.Label4.TabIndex = 6
Me.Label4.Text = "Part Number"
'
'm_partNumberTextBox
'
Me.m_partNumberTextBox.Location = New System.Drawing.Point(90, 120)
Me.m_partNumberTextBox.Name = "m_partNumberTextBox"
Me.m_partNumberTextBox.Size = New System.Drawing.Size(173, 20)
Me.m_partNumberTextBox.TabIndex = 7
Me.m_partNumberTextBox.Text = ""
Me.m_partNumberTextBox.MaxLength = 30
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(112, 168)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 8
Me.Button1.Text = "Ok"
Me.Button1.DialogResult = DialogResult.OK
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 205)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.m_partNumberTextBox)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.m_revNameTextBox)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.m_authorNameTextBox)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.m_partNameTextBox)
Me.Controls.Add(Me.Label1)
Me.Name = "GenerateTitleBlock"
Me.Text = "GenerateTitleBlock"
Me.ResumeLayout(False)

    End Sub

I have been editing this manually, I don't have windows form designer that I am aware of.

Can I add a drop down to this, or do I need to change the entire query box to a UIBlock?

Thanks in advance.

RE: Adding Drob Box to pre-existing Form Class

This code really isn't meant to be edited by hand; but given some knowledge of the format and an inordinately large dose of patience you just might get it to work. The shortcut method would be to get some version of visual studio. Microsoft has 'express' versions for free, check here for the VB.NET version.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources