Re: "Sticking" buttons to the Right Margin

  • From: "RicksPlace" <ofbgmail@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 25 Mar 2010 09:20:04 -0400

Hi Don: I agree fully. I found so much wierd sounding technicals when I wanted to do it that I just went with a fixed page size. You might look at putting those controls inside a TableLayout Panel Winforms control. I think I remember something about automatic ReSizing related to controls inside a TableLayout Panel but will have to go back and do some Googling to see if it had anything to do with what you are trying to do. At the very least, you only have to move around the TableLayout Panel and all the controls inside it are automatically moved and, I think, maintain their relative positions within the Panel. So, if you move the panel over to the right edge of the screen, the endpoint of the panel that is, and you have the panel set up to have 14 pixels or some percentage of space at the right of the panel, then you should, in theory, have that space so long as you maintain the panel at the right edge of the window and I should think ReSizing would take care of that automatically, I don't know but that is what I might try out of the gate and before doing any complicated processes. Also, using pt as your size type might be problematic since that says to maintain a constant size in inches and I do not how it would work when something is ReSized. Why do you need the ReSizing? Is it to keep the form consistent when clients have diferent screen resolutions or something else? For example, do you want the product to run on hand-held devices or on Desk-Top machines or both?

Rick USA
----- Original Message ----- From: "Donald Marang" <donald.marang@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Thursday, March 25, 2010 8:55 AM
Subject: Re: "Sticking" buttons to the Right Margin


That sounds like such a basic thing. I find it incredulous that Visual Studio can grow controls automatically but can not maintain a constant right margin! I suppose I can handle writing code to tweak these positions for the two events you mentioned. They have so many properties like margin and dock that sound like they should take care of this, I thought I was just getting confused between how to set the correct combination. However, if I manually set the placement of the "Perform OCR" button, I would probably need to go back and readjust the position of the "Browse..." button and readjust the size of the "Filename" text edit field as well. As I consider this, I should need to subtract 14 from the x location properties of these two buttons and from the x size of the text box after the standard code is executed for resize events. Do the event handlers you mentioned get performed after the normal processing, before the normal processing, or do I need to explicitly call the normal event processing within my event handlers?

Don Marang

--------------------------------------------------
From: "Martin Slack" <m.g.slack@xxxxxxxxxxxx>
Sent: Thursday, March 25, 2010 3:43 AM
To: <programmingblind@xxxxxxxxxxxxx>
Subject: Re: "Sticking" buttons to the Right Margin

Hi Don,

I guess the simple but boring answer is to read the window size in the form's Resize or ResizeEnd event and then code your spacing calculation on the fly within the same event.

I did think that a control's margin property was intended to keep them from overlapping, but I can't see how to make them honour the setting.

 Martin



----- Original Message ----- From: "Donald Marang" <donald.marang@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Thursday, March 25, 2010 12:24 AM
Subject: "Sticking" buttons to the Right Margin


In my QuickOCR Visual Basic .Net application I wrote in Visual Studio 2008, I have not been able to get the right side alignment correct. My last message had a little better description of the application. I have the source code and more information available at:
http://mysite.verizon.net/marangs/QuickOCR.html

My design layout issue is that the original, and I think minimum size of the main window is 450 x 500. I want it expandable to the full size of the screen if necessary. When expanded I want the "Perform OCR" and "Exit" buttons to stick to the right side of the window, while retaining a 14 pt spacing between the button and the right side of the window. I also want the Text "Results" rich text box and the "Filename" text vbox to grow as well. These boxes grow properly, but I have the same problem with the rich text box as with the buttons. As the window grows, these controls get jammed up against the right side of the window. So far the location and size properties have been calculated to provide the correct spaceing when set the designed size. How should this be accomplished? I have randomly attempted to use other settings, but have not ran across the right combination.

Don Marang
__________
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


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: