PC Review


Reply
Thread Tools Rate Thread

anchor row of buttons with equal spacing?

 
 
davebrennan1975@hotmail.com
Guest
Posts: n/a
 
      22nd Mar 2005
I have a WinForms application that displays multiple choice questions
(the choices are actually radio buttons with Appearance=Button).
Depending on the question, I may have 3, 4, or 5 choices to display.
I'm using a panel as a container for the choices. Since the form needs
to is resizable, I need to keep the spacing between the buttons equal
as the form width changes. I know this can be done with anchoring and
perhaps using some sub-panels, but I just can't get the exact
combination right. Any suggestions? Thanks.

-Dave

 
Reply With Quote
 
 
 
 
Tim Wilson
Guest
Posts: n/a
 
      22nd Mar 2005
Anchoring would really only allow the outside controls to maintain their
positions. The controls in between the two outer controls would need to be
calculated. You might consider hooking the Resize event of the parent Panel
and calculating, based on the number of child RadioButton controls, how much
space should be between each control to maintain a proportional look. Then
adjust the location of each control based on the amount of available space.

Just as FYI, the next version of the framework there are some nice features
that should really help in this area.

--
Tim Wilson
..Net Compact Framework MVP

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a WinForms application that displays multiple choice questions
> (the choices are actually radio buttons with Appearance=Button).
> Depending on the question, I may have 3, 4, or 5 choices to display.
> I'm using a panel as a container for the choices. Since the form needs
> to is resizable, I need to keep the spacing between the buttons equal
> as the form width changes. I know this can be done with anchoring and
> perhaps using some sub-panels, but I just can't get the exact
> combination right. Any suggestions? Thanks.
>
> -Dave
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
anchor for buttons? Co Microsoft VB .NET 4 22nd May 2009 04:13 PM
anchor for buttons? Co Microsoft VB .NET 0 22nd May 2009 03:15 PM
radio buttons to equal values Louis Microsoft Excel Programming 1 11th Jan 2008 10:45 PM
Dynamic Buttons Anchor Property Problem =?Utf-8?B?R3JlZw==?= Microsoft VB .NET 0 23rd Oct 2007 04:35 PM
vb.net anchor spacing maintain marfi95@yahoo.com Microsoft Dot NET Framework Forms 0 20th Jan 2006 04:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:31 AM.