Ability of users to resize Winforms in application runtime


Author
Message
Curt Cadwell
Curt Cadwell
StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)
Group: Forum Members
Posts: 2, Visits: 9
Ok I'm VFP developer and have been developing in VMP framework yeah I know it's about time I get off the fence and start developing in .NET.

Well running the sample apps in Stataframe I haven't seen a way to resize the forms. I did look at the properties autoresize and anchor but noticed the .NET help say's it doesn't work on all the .NET controls and it lists the ones that don't work. My question is if VMP framework can do it in VFP surely .NET and Strataframe can?

I'm a Newbe so be gentle...

Thanks so much

Curt Cadwell

Replies
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
If you cannot resize the form itself, then the property you need to change on the form is the FormBorderStyle property. 

However, if you can resize the form, but the controls just stay in the same place, then there are a couple things you should look at adjusting.  The first is the Dock property on a control.  This is helpful to have a child completely fill to the entire parent size (fill) or to the top, right, bottom, or left of the parent control.  When the parent resizes, then the control resizes as well.  Docking is really only useful for panels and splitter containers and such.  The next property that you need to look into is the Anchor property.  Unlike Dock, the Anchor is bitwise, meaning that a control can be anchored to both the top and left, or the top, left and right, or just the left (or any combination of top, right, bottom, left).  What the Anchor does is keep the edge of the control at the same distance from the edge of the parent no matter what.  By default, everything is anchored to the top and left, so when you resize, they all stay put, (because the origin (0,0) is at the top left, so the controls always stay the same distance from it).  So, if you take a textbox and anchor it to the top, right and left, then when you change the width of the form, the right side of the textbox will stay the same distance from the right side of the form (same as the left side does); this will cause the textbox to resize.  Anchoring on all 4 sides will cause the control to resize it's height as well.

Open up the VS help and search for Dock and Anchor.  They're properties that exist on all controls and will definitely get you going.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Curt,



I took a look at the sight you indicated and you are correct, .NET doesn't support this sort of thing out of the box. What you want is for the size of the controls, fonts, graphics to proportionally resize as the form resizes. I.e. this is more of an accessibility issue. Someone with bad eye sight wants the form to be bigger, so they can see it more clearly, thus they want the buttons to be bigger, the fonts to increase...the information displayed is the same, just bigger.



.NET handles two other issues out of the box:



- resizing controls as the form resizes. This is what we've talked about in this post. The font and graphic size are constant, so resizing means that more or less info is visible. This behaves just like windows explorer does when resized. Make the form bigger, you see more file/folders. Make is smaller, you see fewer.



- scaling forms based on desktop resolution. .Net can handle resizing fonts, controls if the user changes their screen resolution. I.e. they change from 96 to 120 dpi, the fonts, controls get bigger.



So, you are either looking at a lot of work, or purchasing a solution such as the one you posted a link to. Sorry Ermm
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You're only other option, Curt would be to move to WPF programming... since WPF forms can scale any size since they are all vector based.  However, there's not really any way to program in WPF right now except to write the XML code manually because the forms designers won't be available until the next version of Visual Studio.
William Fields
William Fields
StrataFrame User (328 reputation)StrataFrame User (328 reputation)StrataFrame User (328 reputation)StrataFrame User (328 reputation)StrataFrame User (328 reputation)StrataFrame User (328 reputation)StrataFrame User (328 reputation)StrataFrame User (328 reputation)StrataFrame User (328 reputation)
Group: StrataFrame Users
Posts: 80, Visits: 239
Hello Greg,

I'm in the same boat as many developers, my users want the ability to resize AND zoom forms/controls. I've seen a few WPF samples, and that's exactly what I'm looking for. But SF does not support WPF. Are there any plans to incorporate zooming capabilities in the SF framework, or has SF decided when WPF support will be incorporated into the framework?

Alternately, can anyone recommend the Fengari Software WinFormResizer product? It seems like a small price to pay for zooming capabilities.

Thanks.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search