.NET type casting 
Author Message
 .NET type casting

I have created a successful mouse click event handler and applied it to a
PictureBox. The handler is of the form:

void PB_Click( System::Object *pb_object, System::EventArgs *e )
{
     // handler code to go here

Quote:
}

Now, I know that 'pb_object' is a PictureBox. How to I access 'pb_object' as
a PictureBox?

/== Peteroid ==\

PS  - This is in the context of a Managed C++ project in VC++ .NET.



Thu, 27 Jan 2005 00:25:21 GMT  
 .NET type casting
Use static_cast

Nish


Quote:
> I have created a successful mouse click event handler and applied it to a
> PictureBox. The handler is of the form:

> void PB_Click( System::Object *pb_object, System::EventArgs *e )
> {
>      // handler code to go here
> }

> Now, I know that 'pb_object' is a PictureBox. How to I access 'pb_object'
as
> a PictureBox?

> /== Peteroid ==\

> PS  - This is in the context of a Managed C++ project in VC++ .NET.



Thu, 27 Jan 2005 00:34:06 GMT  
 .NET type casting
Thanx! That works... )

 /== Peteroid ==\


Quote:
> Use static_cast

> Nish



> > I have created a successful mouse click event handler and applied it to
a
> > PictureBox. The handler is of the form:

> > void PB_Click( System::Object *pb_object, System::EventArgs *e )
> > {
> >      // handler code to go here
> > }

> > Now, I know that 'pb_object' is a PictureBox. How to I access
'pb_object'
> as
> > a PictureBox?

> > /== Peteroid ==\

> > PS  - This is in the context of a Managed C++ project in VC++ .NET.



Thu, 27 Jan 2005 03:25:41 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. type cast problem of C++ in .Net

2. Type Casting between Base and Derived Type (Serialization of objects with Type members)

3. type casting to / from pointers to incomplete data types

4. type casting to / from pointers to incomplete data types

5. cast cstring type to integer type

6. Casting to/from STL types to MFC types

7. Why can't overload type cast to base type (object)

8. type problems with .net types *arrgh*

9. DLL types to .NET types?

10. C# Base Types vs. .NET Types

11. Cast to a dynamic type?

12. Dynamically Type Casting Array[]

 

 
Powered by phpBB® Forum Software