Sharing a handler 
Author Message
 Sharing a handler

Got this one figured out. I give a unique Name to each control, one that
includes the index number in its string. Then parse out and convert number
to index!

  /== Peteroid ==\


Quote:
> Hi Sean,

> I'm creating a Managed C++ Application using VC C++ .NET. I'm creating
> buttons in code using the Button class in .NET Framework
> (System::Windows::Forms). I'm interested in the button being able to
> determine it's index in an array during a Click event, thereby allowing me
> to create an arbitrary array of such buttons on the fly which share one
> Click handler.

> As a matter of focus, imagine I want to create an arbitrary matrix of
> buttons which is W x H in dimensions, and when a button is pressed the
> global variables X and Y are set to the buttons position in the matrix
> (e.g., X=0, Y=3 when the button three buttons down on the far left edge is
> pressed).

> I'd also like to be able to do this with PictureBoxes, but I assume the
> principle and mechanics would be about the same since they are both
Control
> class decendants ... :)

>   /== Peteroid ==\



> > Are you using .NET, ATL, MFC or Win32?



> > > I want to create an array of buttons, and have them all use the same
> click
> > > handler. My code gives each button an index, and I want the handler to
> be
> > > able to figure out the index of the particular button calling it,  and
> > react
> > > accordingly. That is, I want the handler to be able to detect which
> button
> > > is calling it.

> > >   /== Peteroid ==\



Thu, 27 Jan 2005 05:01:37 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. * ISR handlers (interrupt handlers) *

2. Shared Libraries vs. Shared Executables

3. UNIX - Shared, non shared libraries need some information about this subject

4. DLL with shared data/class not sharing...

5. file sharing under DOS (share not necessarily loaded)

6. Share CObArray Object using DLL Section share method

7. MFC method to share/sharing a drive, how?

8. VC7: How to Specify the difference between Dialog Message Handler and Window Message Handler?

9. How to by pass handler and implement the function inside handler directly?

10. Problem With Event Handlers

11. Visual C++ 2003 CTreeCtrl and Message Handlers

12. No error handler in destructor - what happens

 

 
Powered by phpBB® Forum Software