PDA

Click to See Complete Forum and Search --> : WPF Forms


ngreenwood6
Jun 30th, 2009, 12:44 PM
I have 2 questions the first one is about the toolbar control in wpf. I just want it to look like a normal bar without the "ribbon dropdown thingamajig", is that possible? The other one is when I click a button in wpf I want it to look like its clicked and when I click it again I want it released. Is this possible and if so any links or help is appreciated.

NickThissen
Jun 30th, 2009, 01:58 PM
There's a WPF forum, perhaps try it there. I'm sure this thread will be moved soon enough though, there's no need to double post.

techgnome
Jun 30th, 2009, 02:15 PM
not sure about the toolbnar issue.... but for the button, try a checkbox with its style set to "graphical" (I think that's right) that will make it look like a button that can be toggled on & off.

-tg

ngreenwood6
Jun 30th, 2009, 03:13 PM
Thanks didnt realize there was a wpf forum lol. I tried doing the checkbox thing techgnome but I could not find the setting to change to graphical. A little help. Also any mod please move this to the WPF forum and sorry for the inconvenience

si_the_geek
Jun 30th, 2009, 03:18 PM
Thread moved to "WPF, WCF, WF" forum

(thanks for letting us know tg :thumb: )

jmcilhinney
Jul 1st, 2009, 03:02 AM
I tried doing the checkbox thing techgnome but I could not find the setting to change to graphical. A little help. Also any mod please move this to the WPF forum and sorry for the inconvenienceThe CheckBox and RadioButton classes both inherit the ToggleButton class, which is not in the Toolbox. If you add a CheckBox and then change the XAML to <ToggleButton> instead then you'll get the effect you're looking for.

Note that I've never actually used WPF before and I just found that information by Googling checkbox button wpf, following a link to StackOverflow and then looking up MSDN for the ToggleButton they mentioned.

chris128
Jul 1st, 2009, 05:06 AM
Aw I thought for a moment there that JMC had become a WPF user :P
But yeah I wouldn't rely on the Toolbox to provide all of your controls, there are a couple of useful ones that arent in the default toolbox selection.

jmcilhinney
Jul 1st, 2009, 05:24 AM
Aw I thought for a moment there that JMC had become a WPF userI intend to fairly soon. I've been concentrating on ASP.NET MVC for a while but WPF is near the top of my list soonta'sBut yeah I wouldn't rely on the Toolbox to provide all of your controls, there are a couple of useful ones that arent in the default toolbox selection.Oddly, I thought to add the ToggleButton to my Toolbox but the only one I could see in the list was an Office Ribbon component. I guess that they don't intend the ToggleButton to be used directly but rather only as a base class. I guess tg's original advice might be what they intend you to do in this case, much as you do in WinForms with the Appearance property, but all the advice I could find on the subject mentioned the ToggleButton. If it works, I'm happy to use it until I have a concrete reason not to.

chris128
Jul 1st, 2009, 07:04 AM
Yeah well it certainly seems to work as you would expect it to so thats what I am going to use when I have need of such a button (although for what I have in mind I think I will need to customise it to work like this one, which is actually more of a combobox but whatever :) : http://blog.xamltemplates.net/wp-content/uploads/2008/12/xaml_combobox_style.jpg)

ngreenwood6
Jul 1st, 2009, 01:35 PM
Thanks for the help guys I will give it a shot