Simulating button click event


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Simulating button click event

  1. #1
    Rich Golem Guest

    Simulating button click event


    I want to programmatically simulate a button being clicked. I know a button
    has a PerformClick event but this doesn't perform the visualization of the
    button being pressed. If you don't know what I mean, put a button on a form
    and press the enter key. On key down, the button visually changes to give
    a 'pressed' appearance. On key up, the appearance changes back to normal.
    How do I do this programmatically?

    Rich Golem

  2. #2
    James Guest

    Re: Simulating button click event


    Rich,

    Try playing with the button's FlatStyle property. I noticed that when it
    is set to flat it looks like the button is pressed in. Good luck, hope this
    helps.

    James



    "Rich Golem" <Rich@Nospam.com> wrote:
    >
    >I want to programmatically simulate a button being clicked. I know a button
    >has a PerformClick event but this doesn't perform the visualization of the
    >button being pressed. If you don't know what I mean, put a button on a form
    >and press the enter key. On key down, the button visually changes to give
    >a 'pressed' appearance. On key up, the appearance changes back to normal.
    >How do I do this programmatically?
    >
    >Rich Golem



  3. #3
    binary digit Guest

    Re: Simulating button click event

    I know this may sound farfetched but you may want to try and move the mouse
    cursor to where the button is located on your form and then use api to
    perform a mouse click. Although that is alot of work for doing something
    very simple.


    "James" <wolfjj79@sbcglobal.net> wrote in message
    news:3cb19082$1@10.1.10.29...
    >
    > Rich,
    >
    > Try playing with the button's FlatStyle property. I noticed that when it
    > is set to flat it looks like the button is pressed in. Good luck, hope

    this
    > helps.
    >
    > James
    >
    >
    >
    > "Rich Golem" <Rich@Nospam.com> wrote:
    > >
    > >I want to programmatically simulate a button being clicked. I know a

    button
    > >has a PerformClick event but this doesn't perform the visualization of

    the
    > >button being pressed. If you don't know what I mean, put a button on a

    form
    > >and press the enter key. On key down, the button visually changes to give
    > >a 'pressed' appearance. On key up, the appearance changes back to normal.
    > >How do I do this programmatically?
    > >
    > >Rich Golem

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center