Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inherit a control
Message
From
13/05/2005 09:34:14
 
General information
Forum:
ASP.NET
Category:
.NET Compact Framework
Miscellaneous
Thread ID:
01013626
Message ID:
01013831
Views:
12
Einar,

You should be able to add this button class to the ToolBox (I assume the Compact Framework's IDE is similar, I have never used it) and drop it on your Form from the ToolBox, same as you can do for a regular WinForm (even though it sounds like you haven't been doing this).

~~Bonnie



>I created a very simple class:
>
>using System;
>
>namespace SmartDeviceApplication1
>{
>	/// <summary>
>	/// Summary description for Class1.
>	/// </summary>
>	public class Class1:System.Windows.Forms.Button
>	{
>		public Class1()
>		{
>			//
>			// TODO: Add constructor logic here
>			//
>			base.BackColor = System.Drawing.Color.Red;
>		}
>	}
>}
>
>
>Now I want to use my new button (Class1) in my PPC app. So I add a standard button to the designer and change the System.Windows.Forms.Button to Class1 in the code (when creating a PC app I am used to this working). When I go back to the designer the button is gone and if I build the app and run the exe the button is there and is indeed red.
>
>I guess there should be a question in here: How can I inherit from a control and use the new inherited control in my PPC app?
>I did the same thing in a PC app and the button turned red in the designer and did not disapear.
>
>And help/information would be appreciated.
>
>Thanks,
>Einar
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform