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. C#
  4. Mouse Events in windows application C# [modified]

Mouse Events in windows application C# [modified]

Scheduled Pinned Locked Moved C#
csharptutorial
7 Posts 3 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.
  • M Offline
    M Offline
    Mads115
    wrote on last edited by
    #1

    HI In my windows application i am using a button control and a serial port. the working of the button is like power ON/OFF. when i click it shld change to red ie., ON and send a value to port "A" when i click again color change to green OFF and send a value to port "a"..... pls give me some idea how to write the code.....

    modified on Saturday, May 2, 2009 4:07 AM

    A D M 3 Replies Last reply
    0
    • M Mads115

      HI In my windows application i am using a button control and a serial port. the working of the button is like power ON/OFF. when i click it shld change to red ie., ON and send a value to port "A" when i click again color change to green OFF and send a value to port "a"..... pls give me some idea how to write the code.....

      modified on Saturday, May 2, 2009 4:07 AM

      A Offline
      A Offline
      Alan N
      wrote on last edited by
      #2

      Hi, Did you try out the idea you were given several days ago in answer to the same question? http://www.codeproject.com/script/Forums/View.aspx?fid=1649&select=3022978&fr=232#xx3022978xx[^] Alan.

      1 Reply Last reply
      0
      • M Mads115

        HI In my windows application i am using a button control and a serial port. the working of the button is like power ON/OFF. when i click it shld change to red ie., ON and send a value to port "A" when i click again color change to green OFF and send a value to port "a"..... pls give me some idea how to write the code.....

        modified on Saturday, May 2, 2009 4:07 AM

        D Offline
        D Offline
        dan sh
        wrote on last edited by
        #3

        Handle its MouseClick event to change the color.

        जय हिंद

        1 Reply Last reply
        0
        • M Mads115

          HI In my windows application i am using a button control and a serial port. the working of the button is like power ON/OFF. when i click it shld change to red ie., ON and send a value to port "A" when i click again color change to green OFF and send a value to port "a"..... pls give me some idea how to write the code.....

          modified on Saturday, May 2, 2009 4:07 AM

          M Offline
          M Offline
          Mads115
          wrote on last edited by
          #4

          ya i tried it the color is changing for one click only

          D 1 Reply Last reply
          0
          • M Mads115

            ya i tried it the color is changing for one click only

            D Offline
            D Offline
            dan sh
            wrote on last edited by
            #5

            MouseClickEventOfButton
            If red -> make green

            else -> make red

            That is all you need.

            जय हिंद

            M 1 Reply Last reply
            0
            • D dan sh

              MouseClickEventOfButton
              If red -> make green

              else -> make red

              That is all you need.

              जय हिंद

              M Offline
              M Offline
              Mads115
              wrote on last edited by
              #6

              can u give me the code pls

              D 1 Reply Last reply
              0
              • M Mads115

                can u give me the code pls

                D Offline
                D Offline
                dan sh
                wrote on last edited by
                #7

                No. Its your work and not mine. do it yourself.

                जय हिंद

                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