CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    10

    How do I change button states via SW (rather than mouse)

    I want to manipulate the state of a button control (selected, focused, down, deselected) via SW data rather than from a mouse click. I'll liken this to player piano keys moving via the music roll. I need a push in the right direction and any suggestions are appreciated. This is my second request. Someone please respond.


  2. #2
    Join Date
    May 1999
    Posts
    10

    Re: How do I change button states via SW (rather than mouse)

    I guess I have to answer my own question. I figured out that resources can be manipulated to simulate button clicks etc. by sending messages to the resource using the following code:

    ::SendMessage(GetDlgItem(nButtonID)->m_hWnd, BM_CLICK, TRUE, 0);

    and the various button messages. Thanks to myself.


  3. #3
    Join Date
    Jun 1999
    Posts
    3

    Re: How do I change button states via SW (rather than mouse)

    I have accomplished this using owner draw buttons. In my code, I assigned member variables to the buttons as type CButton, then manually changed them from this to CBitmapButton. This class allows you to load bitmap images that correspond to each button state. Hope this helps. For more info, just email me at [email protected]. I'd be willing to share source code.

    Andy

  4. #4
    Join Date
    May 1999
    Posts
    10

    Re: How do I change button states via SW (rather than mouse)

    Deja vu, that's precisely what I did in building my multimedia components. Thanks. I've noted your e-mail and hope you do the same.


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

Featured