INTERACT FORUM
Windows => Plug-in Development => Topic started by: bugmenot on November 27, 2008, 09:57:22 pm
-
Hi,
I used the template for Visual studio 2005 in C# to build an interface plugin. Unfortunatly the buttons do not skin themself based on the skin applyed in MC.
This is what I have :
http://screencast.com/t/71OmxFwoo (http://screencast.com/t/71OmxFwoo)
(http://content.screencast.com/users/Lucian.jp/folders/Jing/media/f14fcc50-33ac-42a7-8516-9c3044912c1b/2008-11-27_2246.png)
This is what I am trying to achieve:
http://screencast.com/t/dtyvch9kl2G (http://screencast.com/t/dtyvch9kl2G)
(http://content.screencast.com/users/Lucian.jp/folders/Jing/media/238b843f-e338-4b14-a7d9-f32863ff08b8/2008-11-27_2251.png)
There is basic skinning behavior in the template for the background and foreground color of controls, but I think button don'T have any forground and background color. Heres is a snippet :
// Setting the Fore- and Backcolors of all Controls (if different)
private void setAllColors(Control control)
{
while (control != null)
{
setBackColor(control, getColor("Tree", "BackColor"));
setForeColor(control, getColor("Tree", "TextColor"));
control = mainPanel.GetNextControl(control, true);
}
}
Any help to achieve a skinned button will be gladly appreciated
Thx
-
Still in top of thread so useless to bump to top, but still no answers yet. Any dev on MC could help on this and http://yabb.jriver.com/interact/index.php?topic=49412.0 ? Community seem to have no answer for me.
-
.NET buttons are owner-draw (meaning .NET skins them), so our skinning engine leaves them alone.
You would have to use a standard Windows button (not owner draw) to get it to skin.
-
From an answer I got on Stackoverflow
The controls in Windows.Forms are not owner-drawn, but rather system-drawn.
Note that when I set the button to flat style, I get the right background color and text color, but button doesn't have the rounded corner and their is no hover effect on those. As I write those line it's the best I was able to achieve.