HughLerwill
Programmer
Dear all,
XP style Command button User Control
I've been getting a little tired of putting command buttons inside picture boxes to get them to display as intended when using XP style, and this does not work well when buttons are loaded or moved or made invisible at runtime; so I thought I'd try and write a User control to overcome the problem. I am not experienced in writing User Controls.
The test project just now consists of;
The User Control; has no code and is completely bare except for a Command button.
Form1 with one User Control placed within a Frame on it
Module1; which calls InitCommonControls and Shows Form1
When compiled the exe runs as expected and displays Form1 with the User Control; the button is rendered in XP style.
When I quit the exe I get an error; 'Project1 has encountered a problem and needs to close ...'
If I remove the user control the error is not produced.
I realize I will have to add code to the User Control for it to function like a normal Command button but am reluctant to waste time if the idea is a no hoper.
Is use of User Controls with XP styles possible?
If so what should I do to prevent the error?
regards Hugh
XP style Command button User Control
I've been getting a little tired of putting command buttons inside picture boxes to get them to display as intended when using XP style, and this does not work well when buttons are loaded or moved or made invisible at runtime; so I thought I'd try and write a User control to overcome the problem. I am not experienced in writing User Controls.
The test project just now consists of;
The User Control; has no code and is completely bare except for a Command button.
Form1 with one User Control placed within a Frame on it
Module1; which calls InitCommonControls and Shows Form1
When compiled the exe runs as expected and displays Form1 with the User Control; the button is rendered in XP style.
When I quit the exe I get an error; 'Project1 has encountered a problem and needs to close ...'
If I remove the user control the error is not produced.
I realize I will have to add code to the User Control for it to function like a normal Command button but am reluctant to waste time if the idea is a no hoper.
Is use of User Controls with XP styles possible?
If so what should I do to prevent the error?
regards Hugh