Bitmap property of custom control, object cannot be created

Discussion in 'ASP .Net Building Controls' started by theis.netronic, Jan 27, 2005.

  1. Hi,

    I have build a custom control with a Bitmap property inside:

    System::Drawing::Bitmap* myBitmap;
    __property System::Drawing::Bitmap* get_Bitmap( void )
    {return myBitmap;}
    __property void set_Bitmap( System::Drawing::Bitmap* tmpBitmap)
    {myBitmap = tmpBitmap;}

    When dragging my control onto a webform the corresponding .aspx file
    looks like following:

    <cc1:ctrl id="myCtrl1" style="Z-INDEX: 102; LEFT: 48px; POSITION:
    TOP: 128px" runat="server" Width="536px" Height="224px"

    1) The parser rises at design time the error: "Parser Error: Cannot
    create an object of type 'System.Drawing.Bitmap' from its string
    representation 'System.Drawing.Bitmap' for the 'Bitmap' property"
    What is wrong? Which class- or property-attributes (e.g. ParseChildren
    ....) must be set? What else is to be done?

    2) Is it possible at design time to save values of complex properties
    to the the .resx file of the webform? With windows forms controls the
    ide (e.g. Visual Studio 2003) uses codeDOMSerialization to do that,
    but I didn't succeed in doing it with a web server control.

    theis.netronic, Jan 27, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.