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. Web Development
  3. ASP.NET
  4. case structure in vb.net!!! [modified]

case structure in vb.net!!! [modified]

Scheduled Pinned Locked Moved ASP.NET
questioncsharphelp
8 Posts 2 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???

    M 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???

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      Second one is correct.

      Rharzkie wrote:

      in the other code, the 1st button is only functioning..

      It depend on what this variable got. dim keyin as integer My example ~ Private Sub ToolStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolStrip1.ItemClicked Select Case e.ClickedItem.Text Case "&New" : MessageBox.Show("this is New") Case "&Open" : MessageBox.Show("this is New") End Select End Sub

      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

      R 2 Replies Last reply
      0
      • M Michael Sync

        Second one is correct.

        Rharzkie wrote:

        in the other code, the 1st button is only functioning..

        It depend on what this variable got. dim keyin as integer My example ~ Private Sub ToolStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolStrip1.ItemClicked Select Case e.ClickedItem.Text Case "&New" : MessageBox.Show("this is New") Case "&Open" : MessageBox.Show("this is New") End Select End Sub

        Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

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

        in your example, the case "&New" and case "&Open" stands for what??? is it integer or string??? where did you get it???

        M 1 Reply Last reply
        0
        • M Michael Sync

          Second one is correct.

          Rharzkie wrote:

          in the other code, the 1st button is only functioning..

          It depend on what this variable got. dim keyin as integer My example ~ Private Sub ToolStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolStrip1.ItemClicked Select Case e.ClickedItem.Text Case "&New" : MessageBox.Show("this is New") Case "&Open" : MessageBox.Show("this is New") End Select End Sub

          Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

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

          but in the second code i made, the first button is only funtioning... i will try your example...

          M 1 Reply Last reply
          0
          • R Rharzkie

            in your example, the case "&New" and case "&Open" stands for what??? is it integer or string??? where did you get it???

            M Offline
            M Offline
            Michael Sync
            wrote on last edited by
            #5

            Friend WithEvents NewToolStripButton As System.Windows.Forms.ToolStripButton Friend WithEvents OpenToolStripButton As System.Windows.Forms.ToolStripButton Me.NewToolStripButton.Text = "&New" Me.OpenToolStripButton.Text = "&Open" Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.NewToolStripButton, Me.OpenToolStripButton)

            Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

            1 Reply Last reply
            0
            • R Rharzkie

              but in the second code i made, the first button is only funtioning... i will try your example...

              M Offline
              M Offline
              Michael Sync
              wrote on last edited by
              #6

              Rharzkie wrote:

              but in the second code i made, the first button is only funtioning...

              What did you set to "keyIn" variable??

              Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

              R 1 Reply Last reply
              0
              • M Michael Sync

                Rharzkie wrote:

                but in the second code i made, the first button is only funtioning...

                What did you set to "keyIn" variable??

                Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

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

                keyin as integer...thats all... but i already try your example, and it works, thanks for that...

                M 1 Reply Last reply
                0
                • R Rharzkie

                  keyin as integer...thats all... but i already try your example, and it works, thanks for that...

                  M Offline
                  M Offline
                  Michael Sync
                  wrote on last edited by
                  #8

                  Rharzkie wrote:

                  but i already try your example, and it works, thanks for that..

                  Your welcome. my friend. If it is useful for you, don't forget to vote the message. Thank you too. :)

                  Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)

                  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