Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. case structure...

case structure...

Scheduled Pinned Locked Moved Visual Basic
questionhelp
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rharzkie
    wrote on last edited by
    #1

    in my project, i use toolbar toolbar in my buttons...i used case structure for the functions of each buttons in the toolbar but theres an error in it... my codes goes like this: Select Case Case 0 Dim subjects As New subjects subjects.Show() Me.Hide() Case 1 Dim file_maintenance As New file_maintenance file_maintenance.Show() Me.Hide() Case 2 Dim grade_entry As New grade_entry grade_entry.Show() Me.Hide() End Select is this code correct??? or this: dim keyin as integer Select Case keyIn Case 0 Dim subjects As New subjects subjects.Show() Me.Hide() Case 1 Dim file_maintenance As New file_maintenance file_maintenance.Show() Me.Hide() Case 2 Dim grade_entry As New grade_entry grade_entry.Show() Me.Hide() End Select in the first code, there is an error so i can't run my program... in the other code, the 1st button is only functioning... what is the really correct code for this???

    T L 2 Replies Last reply
    0
    • R Rharzkie

      in my project, i use toolbar toolbar in my buttons...i used case structure for the functions of each buttons in the toolbar but theres an error in it... my codes goes like this: Select Case Case 0 Dim subjects As New subjects subjects.Show() Me.Hide() Case 1 Dim file_maintenance As New file_maintenance file_maintenance.Show() Me.Hide() Case 2 Dim grade_entry As New grade_entry grade_entry.Show() Me.Hide() End Select is this code correct??? or this: dim keyin as integer Select Case keyIn Case 0 Dim subjects As New subjects subjects.Show() Me.Hide() Case 1 Dim file_maintenance As New file_maintenance file_maintenance.Show() Me.Hide() Case 2 Dim grade_entry As New grade_entry grade_entry.Show() Me.Hide() End Select in the first code, there is an error so i can't run my program... in the other code, the 1st button is only functioning... what is the really correct code for this???

      T Offline
      T Offline
      The ANZAC
      wrote on last edited by
      #2

      in the first case statement:

      Rharzkie wrote:

      Select Case

      This should be Select Case myVariable where myVariable is the variable you are referencing to. The second one seems fine, there must be an issue in the way the keyIn is changed, it must not be being changed when the other buttons are pressed.

      Please check out my articles: The ANZAC's articles

      R 1 Reply Last reply
      0
      • T The ANZAC

        in the first case statement:

        Rharzkie wrote:

        Select Case

        This should be Select Case myVariable where myVariable is the variable you are referencing to. The second one seems fine, there must be an issue in the way the keyIn is changed, it must not be being changed when the other buttons are pressed.

        Please check out my articles: The ANZAC's articles

        R Offline
        R Offline
        Rharzkie
        wrote on last edited by
        #3

        but when i used the 2nd codes, the first button is only functioning...in the other button, the function also same as the ist button (it should not be the same)...in short, case 1 in only functioning but the others did not...what's wrong with that???

        T 1 Reply Last reply
        0
        • R Rharzkie

          but when i used the 2nd codes, the first button is only functioning...in the other button, the function also same as the ist button (it should not be the same)...in short, case 1 in only functioning but the others did not...what's wrong with that???

          T Offline
          T Offline
          Tom Deketelaere
          wrote on last edited by
          #4

          like The ANZAC said the second case looks to be correct the problem may lay in how you change you're variable keyin perhaps debugging the project and looking at when the keyin variable is changed or not changed will help you further from the behavior you described my guess would be that the keyin variable isn't changed therfor the same code is excecuted for all buttons

          1 Reply Last reply
          0
          • R Rharzkie

            in my project, i use toolbar toolbar in my buttons...i used case structure for the functions of each buttons in the toolbar but theres an error in it... my codes goes like this: Select Case Case 0 Dim subjects As New subjects subjects.Show() Me.Hide() Case 1 Dim file_maintenance As New file_maintenance file_maintenance.Show() Me.Hide() Case 2 Dim grade_entry As New grade_entry grade_entry.Show() Me.Hide() End Select is this code correct??? or this: dim keyin as integer Select Case keyIn Case 0 Dim subjects As New subjects subjects.Show() Me.Hide() Case 1 Dim file_maintenance As New file_maintenance file_maintenance.Show() Me.Hide() Case 2 Dim grade_entry As New grade_entry grade_entry.Show() Me.Hide() End Select in the first code, there is an error so i can't run my program... in the other code, the 1st button is only functioning... what is the really correct code for this???

            L Offline
            L Offline
            leckey 0
            wrote on last edited by
            #5

            That is all.

            _____________________________________________ Flea Market! It's just like...it's just like...A MINI-MALL!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups