Combo Box and Button behaviour

Chixor

New member
Joined
Jun 3, 2006
Messages
2
Programming Experience
Beginner
Hello all, my apologies if this may be in the wrong area.
I have created an application that contains a combo box pulling data from an access database.
The combo box allows the user to select an item, which then displays an image of the item and the items components in the application.
If I start up my app and if I dont touch the combo box I can enter in my data and use the exit / calculate buttons.
However if I select the combo box and change the item, I can no longer use either my text box to enter data or any of my buttons.
Im not sure what may be wrong.
Im also not sure if what code you may need to assist in troubleshooting so I have expanded the windows components and included everything.

VB.NET:
Option Explicit On
Option Strict On
 
Public Class AlchemyCalcForm
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 uiExitButton As System.Windows.Forms.Button
Friend WithEvents uiCalcButton As System.Windows.Forms.Button
Friend WithEvents uiSaveButton As System.Windows.Forms.Button
Friend WithEvents uiPrintButton As System.Windows.Forms.Button
Friend WithEvents uiSelectGroupBox As System.Windows.Forms.GroupBox
Friend WithEvents uiIngredientsGroupBox As System.Windows.Forms.GroupBox
Friend WithEvents uiNumSelectLabel As System.Windows.Forms.Label
Friend WithEvents uiNumSelectTextBox As System.Windows.Forms.TextBox
Friend WithEvents uiIngredientLabel1 As System.Windows.Forms.Label
Friend WithEvents uiIngredientNameLabel As System.Windows.Forms.Label
Friend WithEvents uiIngredientLabel4 As System.Windows.Forms.Label
Friend WithEvents uiIngredientLabel3 As System.Windows.Forms.Label
Friend WithEvents uiIngredientLabel2 As System.Windows.Forms.Label
Friend WithEvents uiQtyFourLabel As System.Windows.Forms.Label
Friend WithEvents uiQtyThreeLabel As System.Windows.Forms.Label
Friend WithEvents uiQtyTwoLabel As System.Windows.Forms.Label
Friend WithEvents uiQtyOneLabel As System.Windows.Forms.Label
Friend WithEvents uiQuantityRequiredLabel As System.Windows.Forms.Label
Friend WithEvents uiQuantityLabel As System.Windows.Forms.Label
Friend WithEvents uiQtyReqFourLabel As System.Windows.Forms.Label
Friend WithEvents uiQtyReqThreeLabel As System.Windows.Forms.Label
Friend WithEvents uiQtyReqTwoLabel As System.Windows.Forms.Label
Friend WithEvents uiQtyReqOneLabel As System.Windows.Forms.Label
Friend WithEvents uiPotionNameComboBox As System.Windows.Forms.ComboBox
Friend WithEvents WowalchemyDataSet As AlchemyCalc.wowalchemyDataSet
Friend WithEvents Tbl_PotionBindingSource As System.Windows.Forms.BindingSource
Friend WithEvents Tbl_PotionTableAdapter As AlchemyCalc.wowalchemyDataSetTableAdapters.Tbl_PotionTableAdapter
Friend WithEvents uiPotionSelect As System.Windows.Forms.Label
Friend WithEvents uiPotionPictureBox As System.Windows.Forms.PictureBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(AlchemyCalcForm))
Me.uiExitButton = New System.Windows.Forms.Button
Me.uiCalcButton = New System.Windows.Forms.Button
Me.uiSaveButton = New System.Windows.Forms.Button
Me.uiPrintButton = New System.Windows.Forms.Button
Me.uiSelectGroupBox = New System.Windows.Forms.GroupBox
Me.uiPotionNameComboBox = New System.Windows.Forms.ComboBox
Me.uiNumSelectTextBox = New System.Windows.Forms.TextBox
Me.uiNumSelectLabel = New System.Windows.Forms.Label
Me.uiPotionPictureBox = New System.Windows.Forms.PictureBox
Me.uiIngredientsGroupBox = New System.Windows.Forms.GroupBox
Me.uiQtyReqFourLabel = New System.Windows.Forms.Label
Me.uiQtyReqThreeLabel = New System.Windows.Forms.Label
Me.uiQtyReqTwoLabel = New System.Windows.Forms.Label
Me.uiQtyReqOneLabel = New System.Windows.Forms.Label
Me.uiQtyFourLabel = New System.Windows.Forms.Label
Me.uiQtyThreeLabel = New System.Windows.Forms.Label
Me.uiQtyTwoLabel = New System.Windows.Forms.Label
Me.uiQtyOneLabel = New System.Windows.Forms.Label
Me.uiQuantityRequiredLabel = New System.Windows.Forms.Label
Me.uiQuantityLabel = New System.Windows.Forms.Label
Me.uiIngredientNameLabel = New System.Windows.Forms.Label
Me.uiIngredientLabel4 = New System.Windows.Forms.Label
Me.uiIngredientLabel3 = New System.Windows.Forms.Label
Me.uiIngredientLabel2 = New System.Windows.Forms.Label
Me.uiIngredientLabel1 = New System.Windows.Forms.Label
Me.WowalchemyDataSet = New AlchemyCalc.wowalchemyDataSet
Me.Tbl_PotionBindingSource = New System.Windows.Forms.BindingSource(Me.components)
Me.Tbl_PotionTableAdapter = New AlchemyCalc.wowalchemyDataSetTableAdapters.Tbl_PotionTableAdapter
Me.uiPotionSelect = New System.Windows.Forms.Label
Me.uiSelectGroupBox.SuspendLayout()
CType(Me.uiPotionPictureBox, System.ComponentModel.ISupportInitialize).BeginInit()
Me.uiIngredientsGroupBox.SuspendLayout()
CType(Me.WowalchemyDataSet, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.Tbl_PotionBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'uiExitButton
'
Me.uiExitButton.BackColor = System.Drawing.Color.Transparent
Me.uiExitButton.Font = New System.Drawing.Font("Tahoma", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.uiExitButton.Location = New System.Drawing.Point(197, 399)
Me.uiExitButton.Name = "uiExitButton"
Me.uiExitButton.Size = New System.Drawing.Size(88, 23)
Me.uiExitButton.TabIndex = 0
Me.uiExitButton.Text = "E&xit"
Me.uiExitButton.UseVisualStyleBackColor = False
'
'uiCalcButton
'
Me.uiCalcButton.BackColor = System.Drawing.Color.Transparent
Me.uiCalcButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.uiCalcButton.Location = New System.Drawing.Point(384, 32)
Me.uiCalcButton.Name = "uiCalcButton"
Me.uiCalcButton.Size = New System.Drawing.Size(88, 24)
Me.uiCalcButton.TabIndex = 1
Me.uiCalcButton.Text = "&Calculate"
Me.uiCalcButton.UseVisualStyleBackColor = False
'
'uiSaveButton
'
Me.uiSaveButton.BackColor = System.Drawing.Color.Transparent
Me.uiSaveButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.uiSaveButton.Location = New System.Drawing.Point(384, 72)
Me.uiSaveButton.Name = "uiSaveButton"
Me.uiSaveButton.Size = New System.Drawing.Size(88, 24)
Me.uiSaveButton.TabIndex = 2
Me.uiSaveButton.Text = "&Save"
Me.uiSaveButton.UseVisualStyleBackColor = False
'
'uiPrintButton
'
Me.uiPrintButton.BackColor = System.Drawing.Color.Transparent
Me.uiPrintButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.uiPrintButton.Location = New System.Drawing.Point(384, 112)
Me.uiPrintButton.Name = "uiPrintButton"
Me.uiPrintButton.Size = New System.Drawing.Size(88, 24)
Me.uiPrintButton.TabIndex = 3
Me.uiPrintButton.Text = "&Print"
Me.uiPrintButton.UseVisualStyleBackColor = False
'
'uiSelectGroupBox
'
Me.uiSelectGroupBox.BackColor = System.Drawing.Color.Transparent
Me.uiSelectGroupBox.Controls.Add(Me.uiPotionSelect)
Me.uiSelectGroupBox.Controls.Add(Me.uiPotionNameComboBox)
Me.uiSelectGroupBox.Controls.Add(Me.uiNumSelectTextBox)
Me.uiSelectGroupBox.Controls.Add(Me.uiNumSelectLabel)
Me.uiSelectGroupBox.Controls.Add(Me.uiPotionPictureBox)
Me.uiSelectGroupBox.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.uiSelectGroupBox.Location = New System.Drawing.Point(3, 3)
Me.uiSelectGroupBox.Name = "uiSelectGroupBox"
Me.uiSelectGroupBox.Size = New System.Drawing.Size(375, 151)
Me.uiSelectGroupBox.TabIndex = 4
Me.uiSelectGroupBox.TabStop = False
Me.uiSelectGroupBox.Text = "Select Potion Type and Amount"
'
'uiPotionNameComboBox
'
Me.uiPotionNameComboBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.Tbl_PotionBindingSource, "Potion_Name", True))
Me.uiPotionNameComboBox.DataBindings.Add(New System.Windows.Forms.Binding("SelectedValue", Me.Tbl_PotionBindingSource, "Potion_Name", True))
Me.uiPotionNameComboBox.DataSource = Me.Tbl_PotionBindingSource
Me.uiPotionNameComboBox.DisplayMember = "Potion_Name"
Me.uiPotionNameComboBox.FormattingEnabled = True
Me.uiPotionNameComboBox.Location = New System.Drawing.Point(174, 52)
Me.uiPotionNameComboBox.Name = "uiPotionNameComboBox"
Me.uiPotionNameComboBox.Size = New System.Drawing.Size(195, 26)
Me.uiPotionNameComboBox.TabIndex = 4
'
'uiNumSelectTextBox
'
Me.uiNumSelectTextBox.Location = New System.Drawing.Point(254, 120)
Me.uiNumSelectTextBox.Name = "uiNumSelectTextBox"
Me.uiNumSelectTextBox.Size = New System.Drawing.Size(100, 24)
Me.uiNumSelectTextBox.TabIndex = 3
Me.uiNumSelectTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
'
'uiNumSelectLabel
'
Me.uiNumSelectLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.uiNumSelectLabel.Location = New System.Drawing.Point(6, 120)
Me.uiNumSelectLabel.Name = "uiNumSelectLabel"
Me.uiNumSelectLabel.Size = New System.Drawing.Size(192, 28)
Me.uiNumSelectLabel.TabIndex = 2
Me.uiNumSelectLabel.Text = "Enter the Number of Potions you want to make:"
Me.uiNumSelectLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'uiPotionPictureBox
'
Me.uiPotionPictureBox.DataBindings.Add(New System.Windows.Forms.Binding("Image", Me.Tbl_PotionBindingSource, "item_image", True))
Me.uiPotionPictureBox.Location = New System.Drawing.Point(9, 29)
Me.uiPotionPictureBox.Name = "uiPotionPictureBox"
Me.uiPotionPictureBox.Size = New System.Drawing.Size(88, 76)
Me.uiPotionPictureBox.TabIndex = 1
Me.uiPotionPictureBox.TabStop = False
'
'uiIngredientsGroupBox
'
Me.uiIngredientsGroupBox.BackColor = System.Drawing.Color.Transparent
Me.uiIngredientsGroupBox.Controls.Add(Me.uiQtyReqFourLabel)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiQtyReqThreeLabel)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiQtyReqTwoLabel)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiQtyReqOneLabel)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiQtyFourLabel)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiQtyThreeLabel)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiQtyTwoLabel)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiQtyOneLabel)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiQuantityRequiredLabel)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiQuantityLabel)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiIngredientNameLabel)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiIngredientLabel4)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiIngredientLabel3)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiIngredientLabel2)
Me.uiIngredientsGroupBox.Controls.Add(Me.uiIngredientLabel1)
Me.uiIngredientsGroupBox.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.uiIngredientsGroupBox.Location = New System.Drawing.Point(16, 160)
Me.uiIngredientsGroupBox.Name = "uiIngredientsGroupBox"
Me.uiIngredientsGroupBox.Size = New System.Drawing.Size(460, 220)
Me.uiIngredientsGroupBox.TabIndex = 5
Me.uiIngredientsGroupBox.TabStop = False
Me.uiIngredientsGroupBox.Text = "Ingredients "
'
'uiQtyReqFourLabel
'
Me.uiQtyReqFourLabel.BackColor = System.Drawing.Color.White
Me.uiQtyReqFourLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.uiQtyReqFourLabel.Location = New System.Drawing.Point(337, 185)
Me.uiQtyReqFourLabel.Name = "uiQtyReqFourLabel"
Me.uiQtyReqFourLabel.Size = New System.Drawing.Size(67, 23)
Me.uiQtyReqFourLabel.TabIndex = 14
'
'uiQtyReqThreeLabel
'
Me.uiQtyReqThreeLabel.BackColor = System.Drawing.Color.White
Me.uiQtyReqThreeLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.uiQtyReqThreeLabel.Location = New System.Drawing.Point(337, 147)
Me.uiQtyReqThreeLabel.Name = "uiQtyReqThreeLabel"
Me.uiQtyReqThreeLabel.Size = New System.Drawing.Size(67, 23)
Me.uiQtyReqThreeLabel.TabIndex = 13
'
'uiQtyReqTwoLabel
'
Me.uiQtyReqTwoLabel.BackColor = System.Drawing.Color.White
Me.uiQtyReqTwoLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.uiQtyReqTwoLabel.Location = New System.Drawing.Point(337, 113)
Me.uiQtyReqTwoLabel.Name = "uiQtyReqTwoLabel"
Me.uiQtyReqTwoLabel.Size = New System.Drawing.Size(67, 23)
Me.uiQtyReqTwoLabel.TabIndex = 12
'
'uiQtyReqOneLabel
'
Me.uiQtyReqOneLabel.BackColor = System.Drawing.Color.White
Me.uiQtyReqOneLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.uiQtyReqOneLabel.Location = New System.Drawing.Point(337, 74)
Me.uiQtyReqOneLabel.Name = "uiQtyReqOneLabel"
Me.uiQtyReqOneLabel.Size = New System.Drawing.Size(67, 23)
Me.uiQtyReqOneLabel.TabIndex = 11
'
'uiQtyFourLabel
'
Me.uiQtyFourLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.uiQtyFourLabel.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.Tbl_PotionBindingSource, "item_qty4", True))
Me.uiQtyFourLabel.Location = New System.Drawing.Point(202, 185)
Me.uiQtyFourLabel.Name = "uiQtyFourLabel"
Me.uiQtyFourLabel.Size = New System.Drawing.Size(67, 23)
Me.uiQtyFourLabel.TabIndex = 10
'
'uiQtyThreeLabel
'
Me.uiQtyThreeLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.uiQtyThreeLabel.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.Tbl_PotionBindingSource, "item_qty3", True))
Me.uiQtyThreeLabel.Location = New System.Drawing.Point(202, 147)
Me.uiQtyThreeLabel.Name = "uiQtyThreeLabel"
Me.uiQtyThreeLabel.Size = New System.Drawing.Size(67, 23)
Me.uiQtyThreeLabel.TabIndex = 9
'
'uiQtyTwoLabel
'
Me.uiQtyTwoLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.uiQtyTwoLabel.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.Tbl_PotionBindingSource, "item_qty2", True))
Me.uiQtyTwoLabel.Location = New System.Drawing.Point(202, 113)
Me.uiQtyTwoLabel.Name = "uiQtyTwoLabel"
Me.uiQtyTwoLabel.Size = New System.Drawing.Size(67, 23)
Me.uiQtyTwoLabel.TabIndex = 8
'
'uiQtyOneLabel
'
Me.uiQtyOneLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.uiQtyOneLabel.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.Tbl_PotionBindingSource, "item_qty1", True))
Me.uiQtyOneLabel.Location = New System.Drawing.Point(202, 74)
Me.uiQtyOneLabel.Name = "uiQtyOneLabel"
Me.uiQtyOneLabel.Size = New System.Drawing.Size(67, 23)
Me.uiQtyOneLabel.TabIndex = 7
'
'uiQuantityRequiredLabel
'
Me.uiQuantityRequiredLabel.Location = New System.Drawing.Point(320, 27)
Me.uiQuantityRequiredLabel.Name = "uiQuantityRequiredLabel"
Me.uiQuantityRequiredLabel.Size = New System.Drawing.Size(99, 41)
Me.uiQuantityRequiredLabel.TabIndex = 6
Me.uiQuantityRequiredLabel.Text = "Quantity Required"
Me.uiQuantityRequiredLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'uiQuantityLabel
'
Me.uiQuantityLabel.AutoSize = True
Me.uiQuantityLabel.Location = New System.Drawing.Point(199, 38)
Me.uiQuantityLabel.Name = "uiQuantityLabel"
Me.uiQuantityLabel.Size = New System.Drawing.Size(70, 18)
Me.uiQuantityLabel.TabIndex = 5
Me.uiQuantityLabel.Text = "Quantity"
'
'uiIngredientNameLabel
'
Me.uiIngredientNameLabel.AutoSize = True
Me.uiIngredientNameLabel.Location = New System.Drawing.Point(31, 38)
Me.uiIngredientNameLabel.Name = "uiIngredientNameLabel"
Me.uiIngredientNameLabel.Size = New System.Drawing.Size(89, 18)
Me.uiIngredientNameLabel.TabIndex = 4
Me.uiIngredientNameLabel.Text = "Item Name"
'
'uiIngredientLabel4
'
Me.uiIngredientLabel4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.uiIngredientLabel4.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.Tbl_PotionBindingSource, "item_ingredient4", True))
Me.uiIngredientLabel4.Location = New System.Drawing.Point(6, 185)
Me.uiIngredientLabel4.Name = "uiIngredientLabel4"
Me.uiIngredientLabel4.Size = New System.Drawing.Size(145, 23)
Me.uiIngredientLabel4.TabIndex = 3
'
'uiIngredientLabel3
'
Me.uiIngredientLabel3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.uiIngredientLabel3.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.Tbl_PotionBindingSource, "item_ingredient3", True))
Me.uiIngredientLabel3.Location = New System.Drawing.Point(6, 147)
Me.uiIngredientLabel3.Name = "uiIngredientLabel3"
Me.uiIngredientLabel3.Size = New System.Drawing.Size(145, 23)
Me.uiIngredientLabel3.TabIndex = 2
'
'uiIngredientLabel2
'
Me.uiIngredientLabel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.uiIngredientLabel2.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.Tbl_PotionBindingSource, "item_ingredient2", True))
Me.uiIngredientLabel2.Location = New System.Drawing.Point(6, 113)
Me.uiIngredientLabel2.Name = "uiIngredientLabel2"
Me.uiIngredientLabel2.Size = New System.Drawing.Size(145, 23)
Me.uiIngredientLabel2.TabIndex = 1
'
'uiIngredientLabel1
'
Me.uiIngredientLabel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.uiIngredientLabel1.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.Tbl_PotionBindingSource, "item_ingredient1", True))
Me.uiIngredientLabel1.Location = New System.Drawing.Point(6, 74)
Me.uiIngredientLabel1.Name = "uiIngredientLabel1"
Me.uiIngredientLabel1.Size = New System.Drawing.Size(145, 23)
Me.uiIngredientLabel1.TabIndex = 0
'
'WowalchemyDataSet
'
Me.WowalchemyDataSet.DataSetName = "wowalchemyDataSet"
Me.WowalchemyDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
'
'Tbl_PotionBindingSource
'
Me.Tbl_PotionBindingSource.DataMember = "Tbl_Potion"
Me.Tbl_PotionBindingSource.DataSource = Me.WowalchemyDataSet
'
'Tbl_PotionTableAdapter
'
Me.Tbl_PotionTableAdapter.ClearBeforeFill = True
'
'uiPotionSelect
'
Me.uiPotionSelect.AutoSize = True
Me.uiPotionSelect.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.uiPotionSelect.Location = New System.Drawing.Point(171, 34)
Me.uiPotionSelect.Name = "uiPotionSelect"
Me.uiPotionSelect.Size = New System.Drawing.Size(138, 15)
Me.uiPotionSelect.TabIndex = 5
Me.uiPotionSelect.Text = "Select Potion Name:"
'
'AlchemyCalcForm
'
Me.AutoScaleBaseSize = New System.Drawing.Size(7, 17)
Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
Me.ClientSize = New System.Drawing.Size(511, 433)
Me.ControlBox = False
Me.Controls.Add(Me.uiIngredientsGroupBox)
Me.Controls.Add(Me.uiSelectGroupBox)
Me.Controls.Add(Me.uiPrintButton)
Me.Controls.Add(Me.uiSaveButton)
Me.Controls.Add(Me.uiCalcButton)
Me.Controls.Add(Me.uiExitButton)
Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
Me.MinimizeBox = False
Me.Name = "AlchemyCalcForm"
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "World of Warcraft -- Alchemy Calculator"
Me.uiSelectGroupBox.ResumeLayout(False)
Me.uiSelectGroupBox.PerformLayout()
CType(Me.uiPotionPictureBox, System.ComponentModel.ISupportInitialize).EndInit()
Me.uiIngredientsGroupBox.ResumeLayout(False)
Me.uiIngredientsGroupBox.PerformLayout()
CType(Me.WowalchemyDataSet, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Tbl_PotionBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
 
End Sub
 
#End Region
 
Private Sub uiExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles uiExitButton.Click
Me.Close()
 
End Sub
 
 
Private Sub AlchemyCalcForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'WowalchemyDataSet.Tbl_Potion' table. You can move, or remove it, as needed.
Me.Tbl_PotionTableAdapter.Fill(Me.WowalchemyDataSet.Tbl_Potion)
End Sub
 
 
Private Sub uiCalcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles uiCalcButton.Click
'calculate the quantity required 
Dim qty As Double
Dim itemqty1 As Double
Dim itemqty2 As Double
Dim itemqty3 As Double
Dim itemqty4 As Double
Dim qtyreq1 As Double
Dim qtyreq2 As Double
Dim qtyreq3 As Double
Dim qtyreq4 As Double
 
'assign qty as variable
qty = Double.Parse(Me.uiNumSelectTextBox.Text)
 
'assign item qtys As variable
itemqty1 = Double.Parse(Me.uiQtyOneLabel.Text)
itemqty2 = Double.Parse(Me.uiQtyTwoLabel.Text)
itemqty3 = Double.Parse(Me.uiQtyThreeLabel.Text)
itemqty4 = Double.Parse(Me.uiQtyFourLabel.Text)
 
If qty <= 0 Then
MessageBox.Show("Quantity must be 1 or more", "Invalid Quantity", MessageBoxButtons.OK, MessageBoxIcon.Error)
 
End If
 
'calculate qty req of each Item
qtyreq1 = itemqty1 * qty
qtyreq2 = itemqty2 * qty
qtyreq3 = itemqty3 * qty
qtyreq4 = itemqty4 * qty
 
'display results
Me.uiQtyReqOneLabel.Text = Convert.ToString(qtyreq1)
Me.uiQtyReqTwoLabel.Text = Convert.ToString(qtyreq2)
Me.uiQtyReqThreeLabel.Text = Convert.ToString(qtyreq3)
Me.uiQtyReqFourLabel.Text = Convert.ToString(qtyreq4)
 
End Sub
 
Private Sub uiNumSelectTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles uiNumSelectTextBox.KeyPress
'Allows only numbers to be entered into this text box
 
If (e.KeyChar < "0" OrElse e.KeyChar > "9") _
AndAlso e.KeyChar <> ControlChars.Back Then
'cancel key6
e.Handled = True
End If
 
End Sub
End Class
 
Last edited by a moderator:
Additional Info if needed.
Im building this in Visual Studio 2005.
I used the "dragging the item from the dataset" to my combo box to create it.


If there is any additional information required to help troubleshoot this please let me know.
Thanks.
 
Hi please post any code that is associated to the combo box ignoring any of the windows designer generated code,

Thanks
 
Back
Top