Checking buttons?!

Aug 1, 2010 at 9:15 PM



I'm using VB.NET and I'm having some trouble with checking buttons in the ribbon!


-How can I make the 'SplitButton' check on click?

-How can I make the basic 'Button' check on click?

-How can I (for instance in a toolbar) make only 1 button be able to be checked at once? For instance in the Word 2010 Justification toolbar, only 1 alignment can be checked at once.



Aug 2, 2010 at 9:46 AM

You can use Fluent:ToggleButton and play with GroupName property. However SplitButton doesn't support checking.

Aug 2, 2010 at 9:00 PM
Thanks, I'll give that a shot. What do you mean 'play with the groupname property'? Is that how I can make only 1 button check at once? Could you be more detailed? SplitButton doesn't support checking? Sorry, but what is the point of a SplitButton that doesn't support checking? Isn't the whole idea that you can check the top half, or select similiar tools from the dropdown? Will this be supported in V2? Thanks a lot!
Aug 3, 2010 at 11:26 AM

-How do I ensure that at least 1 button in a group is checked at all times?

-Is there any way I can replicate a splitbutton check functionality?



Aug 3, 2010 at 1:31 PM
Edited Aug 3, 2010 at 1:32 PM

<ToogleButton Text="A" GroupName="MyButtons" IsChecked="True".../>
<ToogleButton Text="B" GroupName="MyButtons" .../>
<ToogleButton Text="C" GroupName="MyButtons" .../>


Aug 3, 2010 at 10:26 PM
Thanks, but can you answer my two questions above? :)
Aug 4, 2010 at 5:41 AM

That was the answer to the first question.
SplitButton with 'checking' should be in v2/v3.

Aug 4, 2010 at 6:04 AM
Ah, I guess you misunderstand my question. I mean how can I ensure that at least 1 button in a group is checked? Like how the justify buttons work in office 2010, one button (any button) has to be checked at all times.
Aug 6, 2010 at 11:18 PM

you don't know daVinci?

The slow developer response really makes it impossible to recommend this product for use commercially - have you considered setting up a Get Satisfaction page?

Aug 8, 2010 at 4:43 AM
I think I have answered your question, the code above works to ensure that at least 1 button in a group is checked. Did you try? If you need another behavior you have to implement your own in code behind.
Aug 14, 2010 at 9:09 AM
I really don't think that code works, and I cannot see how it would work. That code makes 1 button checked on STARTUP, not one button ALWAYS CHECKED. Have you never used the justification buttons in Microsoft Word? One button must ALWAYS be checked, it could be any of them, but at least 1 MUST be checked at all times. How can that be achieved?
Aug 16, 2010 at 11:47 AM
Aug 16, 2010 at 1:16 PM

Try this:

<Fluent:ToggleButton Text="A" Name="leftToggleButton" UseAutoCheck="False" IsChecked="True" Click="OnJustificationClick"/>
<Fluent:ToggleButton Text="B" Name="centerToggleButton" UseAutoCheck="False" Click="OnJustificationClick"/>
<Fluent:ToggleButton Text="C" Name="rightToggleButton" UseAutoCheck="False" Click="OnJustificationClick"/>

void OnJustificationClick(object sender, EventArgs e)
      leftToggleButton.IsChecked = sender == leftToggleButton;
      centerToggleButton.IsChecked = sender == centerToggleButton;
      rightToggleButton.IsChecked = sender == rightToggleButton;