Link to home
Start Free TrialLog in
Avatar of dkloeck
dkloeckFlag for Spain

asked on

Button designer, strange behaviour

I create a Button from the compact framework (well..an extension) and it creates following line:
this.iconButtonPrint.UseVisualStyleBackColor = true;
in the xxx.Designer.cs file

UseVisualStyleBackColor is not part of the COmpat framwork, or so it sais, and does not show anything in the designer. How to do not make it creaet it?
Avatar of gbzhhu
gbzhhu
Flag of United Kingdom of Great Britain and Northern Ireland image

How did you create/extend the button?

I haer that the CF project template has errors.  Can you not comment the line?
Avatar of dkloeck

ASKER

There is a class IconButton which is child of button (in a CF project)
Then there is another IconButtonPc which is child of IconButton (not in CF)

and the last is what I use, but since it derives from a CF project button, shouldn't it have all the properties from the CF, and not the ones for PC?
The way I see it IconButtonPc relies on the implementation of IconButton (which CF control).  The trouble is that you are attempting to create a desktop project and Visual studio will put UseVisualStyleBackColor  since the project is desktop not CF.  When you compile though the basec lass of button (CF) will be run and code in there doesn't have UseVisualStyleBackColor .

That is what I believe is happening?  May I ask why you are mixing CF and desktop development?
Avatar of dkloeck

ASKER

Yeah, that's the problem. Do you know how I could solve it?

I'm using CF and desktop bcos its an application for PDA and PC.

Why is it that VS adds Desktop properties if I am extending a CF type, even if it is in a Desktop project?
ASKER CERTIFIED SOLUTION
Avatar of gbzhhu
gbzhhu
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dkloeck

ASKER

The bad thing is that after rebuilding it, the line apears again :(