Results 1 to 2 of 2

Thread: My variable doesn't work properly

  1. #1

    Thread Starter
    Member
    Join Date
    May 2004
    Location
    Where i am
    Posts
    38

    My variable doesn't work properly

    Basically i've been trying to make something to create something since i got vb.net yesterday but i can't get this bit to work.

    Public Class Main
    Inherits System.Windows.Forms.Form
    Dim var As String
    Dim ability As String
    Dim var2 As String
    Dim About As New About

    Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    var = "00"
    ability = "00"
    var2 = "00"
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
    If ComboBox1.ValueMember = "1" Then var = "70" And var2 = "FA"
    If ComboBox1.ValueMember = "2" Then var = "71" And var2 = "00"

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If var = "00" Then GoTo 2
    TextBox1.Text = "somet" & vbCrLf & "somet" & var & ability & var2 & vbCrLf & "more somet" & vbCrLf & "even more somet"
    Exit Sub
    2: MsgBox("Select an option")
    End Sub

    Any help would be nice
    Last edited by machinist; Jan 16th, 2005 at 05:08 AM.

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: My variable doesn't work properly

    Well, for a start if that is your full code, you haven't declared Weapon or Grind.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width