Keep controls in place when going to and from fullscreen

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
12 posts Page 1 of 2
Contributors
User avatar
jtlusco
VIP - Donator
VIP - Donator
Posts: 138
Joined: Mon Jul 12, 2010 11:28 pm

I am looking for a way to keep a text box in the same spot on a form but re-size for fit when going in and out of full screen
*Update demo project to include image file in resources folder*
You do not have the required permissions to view the files attached to this post.
Last edited by jtlusco on Tue Sep 02, 2014 5:46 pm, edited 2 times in total.
Have you been scripted today
Image
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Have you tried using the anchor property?
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

jtlusco wrote:
I am looking for a way to keep a text box in the same spot on a form but resize for fit when going in and out of full screen
If you don't want it to follow any corners then turn off the default top-left anchor. Adding anchor makes the control "stick" or follow the movement of the form when its size changes
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Yup! Anchor seems to be the property you want to be using.

Image

MSDN link
User avatar
jtlusco
VIP - Donator
VIP - Donator
Posts: 138
Joined: Mon Jul 12, 2010 11:28 pm

The Anchor property does not do what I need.I have added a demo of what I am trying to do when you start the app the textbox is the size. shape, and in the correct place on the form when you go to full screen the textbox is no longer in the same place on the forms graphic I hope this clarifies my question.
Have you been scripted today
Image
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

I understand what you mean now. I don't have access to the actual image (since it's a local resource) but you could try this:

Place a panel, with the background same as the picture, and resize it to fill the form. Then place the textbox within the panel and fix the anchor to: Left, Right, Bottom.
For the Panel, change the Anchor to Top, Left, Right, Bottom (Don't dock it)

I'm not sure whether this works, but it's worth a try.
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
jtlusco
VIP - Donator
VIP - Donator
Posts: 138
Joined: Mon Jul 12, 2010 11:28 pm

I have Updated demo project to include image file in resources folder along with the settings you suggest.
Last edited by jtlusco on Wed Sep 03, 2014 2:37 pm, edited 1 time in total.
Have you been scripted today
Image
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Quick reply #jtlusco, did it work ? I'm on my mac atm and can't check it. I can test-run it at home on my PC (w/ Windows)
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
jtlusco
VIP - Donator
VIP - Donator
Posts: 138
Joined: Mon Jul 12, 2010 11:28 pm

No It did not work for me.
Have you been scripted today
Image
User avatar
clanc789
Coding Guru
Coding Guru
Posts: 786
Joined: Tue Nov 02, 2010 4:45 pm

Maybe set a maximum with of the textbox? I dont know if that works?
Practice makes perfect!

VIP since: 6-10-2011
12 posts Page 1 of 2
Return to “Tutorial Requests”