Re: Visually Arranging Controls in Visual Basic .NET

  • From: Jamal Mazrui <empower@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Thu, 20 Sep 2007 12:54:55 -0400 (EDT)

One thing I like to do with FlowLayoutPanel and TableLayoutPanel is to
combine them to achieve more sophisticated results.  Using the concept of
a band of related controls, I try to divide the form into
FlowLayoutPanels for the horizontal bands, which are then connected by a
vertical FlowLayoutPanel from top to bottom of the form.  For example,
the OK, Cancel, and other buttons are typically in the bottom-most
FlowLayout Panel with no AnchorStyles, thus causing it to be centered.  I
use a TableLayoutPanel for rows of edit fields with a label on the left
and a TextBox on the right.  These container controls have various
properties for fine tuning their spacing if further tweaking is desired.

Jamal

On Thu, 20 Sep 2007, dusty bray wrote:

> Date: Thu, 20 Sep 2007 11:43:51 -0400
> From: dusty bray <dusty_bray@xxxxxxxxxxx>
> Reply-To: programmingblind@xxxxxxxxxxxxx
> To: programmingblind@xxxxxxxxxxxxx
> Subject: Re: Visually Arranging Controls in Visual Basic .NET
>
> Hi Jamal,
>
> Yeah-- from what i read, your program seems like a much, much better
> developed version of what i was trying to do.  i guess using your
> terminology, my application just creates the bands (whose padding depends on
> the height of the form) and divides the bands by the number of controls to
> space them across the form.  So, this seems more useful than the Flow Layout
> Panel (since you can't really tell if related controls will be in the same
> band), and slightly better than Table Layout (which simply places controls
> in a matrix).  By the way, these panels remind me a lot of Java's approach,
> after which i also modeled my classes.
>
> i didn't have the extra time, but i really intended to make something that
> allows the user to specify more semantic relationships between the controls.
>   i think GUI design should work more like the HTML & CSS philosophy of
> "separate logical structure from the visual display".  For instance, an
> input control should have some relationship with it's label, and let an
> alorithm decide where they both should go.  i think this would be beneficial
> for non-impaired users as well; just like CSS, the developer might be able
> to change the look-and-feel of the app on-the-fly.  Sometimes labels are
> placed to the left of input controls; sometimes they're placed above.  It
> would be very convenient if one could switch between the styles dynamically.
>   This fits with my personal philosophy that the incorporation of semantic
> information in more aspects of computing will solve the majority of the
> accessibility problem.  (Call me crazy.)
>
> i'm not sure if your approach already hits on some of these ideas; i didn't
> have a chance to read it very thoroughly.  i want to look at it in more
> detail when i have a chance.
>
> Talk to you later,
>
> dusty.......
>
>
>
>
>
> >From: Jamal Mazrui <empower@xxxxxxxxx>
> >Reply-To: programmingblind@xxxxxxxxxxxxx
> >To: programmingblind@xxxxxxxxxxxxx
> >Subject: Re: Visually Arranging Controls in Visual Basic .NET
> >Date: Tue, 18 Sep 2007 21:49:12 -0400 (EDT)
> >
> >Thanks for your efforts in this area, Dusty, as it is certainly an
> >important one for blind programmers.  Can you elaborate on the
> >heuristics your code uses to position controls?  Inthane is referring to
> >the FlowLayoutPanel and TableLayoutPanel containers that were introduced
> >in the .NET 2.0 Framework.  They can be used to good advantage for
> >positioning controls automatically without having to specify pixel
> >coordinates.  The Dock, Anchor, and AutoSize properties also help in
> >sizing and positioning controls in an acceptable visual manner without
> >either eyesight or tedious arithmetic calculations.
> >
> >FYI -- Your approach seems similar to one I developed in the AutoIt
> >language.  "Layout by Code" is available at
> >http://www.EmpowermentZone.com/lbc.zip
> >
> >Regards,
> >Jamal
> >On Tue, 18 Sep 2007, dusty bray
> >wrote:
> >
> > > Date: Tue, 18 Sep 2007 21:39:08 -0400
> > > From: dusty bray <dusty_bray@xxxxxxxxxxx>
> > > Reply-To: programmingblind@xxxxxxxxxxxxx
> > > To: programmingblind@xxxxxxxxxxxxx
> > > Subject: Re: Visually Arranging Controls in Visual Basic .NET
> > >
> > > Panels??  i don't understand.  How can panels help?  Don't you still
> >have to
> > > position the controls inside the panel?  Is there a built-in way of
> >dealing
> > > with layout?  If so, i wish we knew about it earlier.  smile
> > >
> > > dusty.......
> > >
> > > >From: "inthaneelf" <inthaneelf@xxxxxxxxxxxxxx>
> > > >Reply-To: programmingblind@xxxxxxxxxxxxx
> > > >To: <programmingblind@xxxxxxxxxxxxx>
> > > >Subject: Re: Visually Arranging Controls in Visual Basic .NET
> > > >Date: Tue, 18 Sep 2007 16:43:42 -0700
> > > >
> > > >thanks, I'll take a look in the near future (as soon as I pull myself
> >out
> > > >of my RPG game writing and plunge back into the programming folder),
> > > >
> > > >the only question I have is why he didn't use the built in layout
> >panels?
> > > >
> > > >take care,
> > > >inthane
> > > >. For Blind Programming assistance, Information, Useful Programs, and
> >Links
> > > >to Jamal Mazrui's Text tutorial packages and Applications, visit me at:
> > > >http://grabbag.alacorncomputer.com
> > > >. to be able to view a simple programming project in several
> >programming
> > > >languages, visit the Fruit basket demo site at:
> > > >http://fruitbasketdemo.alacorncomputer.com
> > > >
> > > >----- Original Message ----- From: "dusty bray"
> ><dusty_bray@xxxxxxxxxxx>
> > > >To: <programmingblind@xxxxxxxxxxxxx>
> > > >Sent: Tuesday, September 18, 2007 10:24 AM
> > > >Subject: Visually Arranging Controls in Visual Basic .NET
> > > >
> > > >
> > > >>Hey everyone,
> > > >>
> > > >>i found this VB.NET project on my computer, and i thought maybe
> >someone
> > > >>here could find it helpful.
> > > >>
> > > >>During my last year of college, a professor asked for my help with a
> >blind
> > > >>student who was having trouble with his VB.NET assignments.  The
> >student
> > > >>needed constant assistance because he was unable to arrange the
> >controls
> > > >>on the form by himself.  i threw together a set of classes to arrange
> > > >>controls dynamically.  My method actually seems to work pretty well:
> >it
> > > >>spaces and groups together controls in a fairly attractive manner, no
> > > >>matter the dimensions of the form.  Unfortunately, the student didn't
> >seem
> > > >>very interested in programming, and the semester ended before they
> > > >>actually tried using my solution.
> > > >>
> > > >>But if anyone here would like to try it, the sample project is located
> > > >>here:
> > > >>http://here-i-am.sourceforge.net/UITest.zip
> > > >>Just add the file UIManager.vb to any project and add code to the Form
> > > >>Load event similar to the sample.
> > > >>
> > > >>i'm sorry that it's very thrown together, but maybe someone will find
> >it
> > > >>useful,
> > > >>
> > > >>dusty.......
> > > >>
> > > >>_________________________________________________________________
> > > >>Get the device you want, with the Hotmail® you love.
> > >
> > >>http://www.microsoft.com/windowsmobile/mobilehotmail/default.mspx?WT.mc_ID=MobileHMTagline
> > > >>
> > > >>__________
> > > >>View the list's information and change your settings at
> > > >>//www.freelists.org/list/programmingblind
> > > >>
> > > >
> > > >__________
> > > >View the list's information and change your settings at
> > > >//www.freelists.org/list/programmingblind
> > > >
> > >
> > > _________________________________________________________________
> > > Get a FREE small business Web site and more from Microsoft® Office Live!
> > > http://clk.atdmt.com/MRT/go/aub0930003811mrt/direct/01/
> > >
> > > __________
> > > View the list's information and change your settings at
> > > //www.freelists.org/list/programmingblind
> > >
> >__________
> >View the list's information and change your settings at
> >//www.freelists.org/list/programmingblind
> >
>
> _________________________________________________________________
> More photos; more messages; more whatever. Windows Live Hotmail - NOW with
> 5GB storage.
> http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_5G_0907
>
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>
__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: