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

    ......Is it possible in vc?

    In Visual Basic, one can define an array of controls e.g button control. A consequence of this is all the buttons in this array correspond to a 'single click event' and the index number determines which button is click (its just like combo buttons grouped togather in vc).

    Is this behavour possible for button control in VC? If so, please help!


  2. #2
    Guest

    Re: ......Is it possible in vc?

    ON_CONTROL_RANGE( wNotifyCode, id1, id2, memberFxn )
    Use this macro to map a contiguous range of control IDs to a single message handler function for a specified Windows notification message, such as BN_CLICKED.
    ClassWizard does not support message map ranges, so you must place the macro yourself. Be sure to put it outside the message map //{{AFX_MSG_MAP delimiters.


  3. #3
    Join Date
    May 1999
    Posts
    388

    thanks alot!

    thankx alot, you have saved plenty of my time!


  4. #4
    Join Date
    May 1999
    Posts
    388

    Re: ......Is it possible in vc?

    tell me just one thing more!
    What do we mean by contiguous id numbers, how can an ID be contiguous?

    the following line is in the help for the macro you gave:
    id1 Command ID at the beginning of a contiguous range of control IDs.




  5. #5
    Guest

    Re: ......Is it possible in vc?

    For example, in resource.h of your project


    #define IDC_id1 1001
    #define IDC_id2 1002
    #define IDC_id3 1003
    #define IDC_id4 1004



    contiguous range of control IDs means 1001,1002,1003,1004 is contiguous. IDC_id1 is at the beginning of a contiguous range of control IDs, and IDC_id4 is at the end.


  6. #6
    Join Date
    Jun 1999
    Location
    Pakistan
    Posts
    77

    Re: ......Is it possible in vc?

    this is possible by using the grouping in VC controls and the value can tell you that which control has been clicked on whose event is generated


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