• Top Members
    Reps
    Posts
  • 834 Replies
    2585 Replies
  • 716 Replies
    2025 Replies
  • 331 Replies
    1928 Replies

Keep controls in place when going to and from fullscreen

Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
User avatar
jtlusco
VIP - Donator
Posts: 138

Keep controls in place when going to and from fullscreen

Mon Sep 01, 2014 4:16 am

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 6:46 pm, edited 2 times in total.
Have you been scripted today
Image

User avatar
CodenStuff
Site Admin
Posts: 4367

Re: Keep controls in place when going to and from fullscreen

Mon Sep 01, 2014 5:10 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
Posts: 2025

Re: Keep controls in place when going to and from fullscreen

Mon Sep 01, 2014 9:25 am

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
Posts: 1242

Re: Keep controls in place when going to and from fullscreen

Mon Sep 01, 2014 9:37 am

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

Image

MSDN link

User avatar
jtlusco
VIP - Donator
Posts: 138

Re: Keep controls in place when going to and from fullscreen

Mon Sep 01, 2014 4:25 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
Posts: 2025

Re: Keep controls in place when going to and from fullscreen

Tue Sep 02, 2014 5:41 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
Posts: 138

Re: Keep controls in place when going to and from fullscreen

Tue Sep 02, 2014 6:46 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 3:37 pm, edited 1 time in total.
Have you been scripted today
Image

User avatar
Codex
Coding God
Posts: 2025

Re: Keep controls in place when going to and from fullscreen

Wed Sep 03, 2014 11:46 am

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
Posts: 138

Re: Keep controls in place when going to and from fullscreen

Wed Sep 03, 2014 3:39 pm

No It did not work for me.
Have you been scripted today
Image

User avatar
clanc789
Coding Guru
Posts: 786

Re: Keep controls in place when going to and from fullscreen

Wed Sep 03, 2014 8:11 pm

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

VIP since: 6-10-2011

Post Reply

Return to “Tutorial Requests”