469,609 Members | 1,414 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

RunTime Control Anchor & Font Scaling

Hi all -- I have two questions.

First, I'm adding a control to my form at runtime and the control/form
seems to ignore the anchor property of the runtime control. Any idea
how I can get a runtime control to anchor properly?

Second -- the program I'm writting is supposed to look like a dos
application (long story). When the application is "Normal" aka a
small window then everything looks great. But when I resize the
window to Maximize (going full screen w/o a toolbar) it doesn't look
right. What I'd like to have happen is the font's to rescale based
upon the window size. Any suggestions on how to accomplish this?

Thanks!

Joseph

Jun 12 '07 #1
3 4190
On Jun 12, 6:55 am, Joseph Gruber <joseph.gru...@gmail.comwrote:
Hi all -- I have two questions.

First, I'm adding a control to my form at runtime and the control/form
seems to ignore the anchor property of the runtime control. Any idea
how I can get a runtime control to anchor properly?

Second -- the program I'm writting is supposed to look like a dos
application (long story). When the application is "Normal" aka a
small window then everything looks great. But when I resize the
window to Maximize (going full screen w/o a toolbar) it doesn't look
right. What I'd like to have happen is the font's to rescale based
upon the window size. Any suggestions on how to accomplish this?

Thanks!

Joseph
First, I'm adding a control to my form at runtime and the control/form
seems to ignore the anchor property of the runtime control. Any idea
how I can get a runtime control to anchor properly?
Something like:

MyControl.Anchor = Anchor.Top Or Anchor.Left
Second -- the program I'm writting is supposed to look like a dos
application (long story).
And I'm sure an interesting one :-)
When the application is "Normal" aka a
small window then everything looks great. But when I resize the
window to Maximize (going full screen w/o a toolbar) it doesn't look
right. What I'd like to have happen is the font's to rescale based
upon the window size. Any suggestions on how to accomplish this?'
Any screen shots? Since your not doing a standard app (I assume your
not using textboxes et all since you're going for a DOS look), it's a
bit difficult to tell you how you could resize your fonts since I
don't know how you're using them.

Thanks,

Seth Rowe

Jun 12 '07 #2
On Jun 12, 7:09 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Jun 12, 6:55 am, Joseph Gruber <joseph.gru...@gmail.comwrote:
Hi all -- I have two questions.
First, I'm adding a control to my form at runtime and the control/form
seems to ignore the anchor property of the runtime control. Any idea
how I can get a runtime control to anchor properly?
Second -- the program I'm writting is supposed to look like a dos
application (long story). When the application is "Normal" aka a
small window then everything looks great. But when I resize the
window to Maximize (going full screen w/o a toolbar) it doesn't look
right. What I'd like to have happen is the font's to rescale based
upon the window size. Any suggestions on how to accomplish this?
Thanks!
Joseph
First, I'm adding a control to my form at runtime and the control/form
seems to ignore the anchor property of the runtime control. Any idea
how I can get a runtime control to anchor properly?

Something like:

MyControl.Anchor = Anchor.Top Or Anchor.Left
Second -- the program I'm writting is supposed to look like a dos
application (long story).

And I'm sure an interesting one :-)
When the application is "Normal" aka a
small window then everything looks great. But when I resize the
window to Maximize (going full screen w/o a toolbar) it doesn't look
right. What I'd like to have happen is the font's to rescale based
upon the window size. Any suggestions on how to accomplish this?'

Any screen shots? Since your not doing a standard app (I assume your
not using textboxes et all since you're going for a DOS look), it's a
bit difficult to tell you how you could resize your fonts since I
don't know how you're using them.

Thanks,

Seth Rowe
Regarding the anchor property -- I've set that (on a label) but it
doesn't seem to get configured at runtime. It doesn't anchor.

Can upload a screenshot in a bit -- basically though it's a lot of
labels. Some stretched to the size of the form while other "rows" may
have 2 or 3 labels in a panel.

Jun 12 '07 #3
On Jun 12, 7:28 am, Joseph Gruber <joseph.gru...@gmail.comwrote:
On Jun 12, 7:09 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Jun 12, 6:55 am, Joseph Gruber <joseph.gru...@gmail.comwrote:
Hi all -- I have two questions.
First, I'm adding a control to my form at runtime and the control/form
seems to ignore the anchor property of the runtime control. Any idea
how I can get a runtime control to anchor properly?
Second -- the program I'm writting is supposed to look like a dos
application (long story). When the application is "Normal" aka a
small window then everything looks great. But when I resize the
window to Maximize (going full screen w/o a toolbar) it doesn't look
right. What I'd like to have happen is the font's to rescale based
upon the window size. Any suggestions on how to accomplish this?
Thanks!
Joseph
First, I'm adding a control to my form at runtime and the control/form
seems to ignore the anchor property of the runtime control. Any idea
how I can get a runtime control to anchor properly?
Something like:
MyControl.Anchor = Anchor.Top Or Anchor.Left
Second -- the program I'm writting is supposed to look like a dos
application (long story).
And I'm sure an interesting one :-)
When the application is "Normal" aka a
small window then everything looks great. But when I resize the
window to Maximize (going full screen w/o a toolbar) it doesn't look
right. What I'd like to have happen is the font's to rescale based
upon the window size. Any suggestions on how to accomplish this?'
Any screen shots? Since your not doing a standard app (I assume your
not using textboxes et all since you're going for a DOS look), it's a
bit difficult to tell you how you could resize your fonts since I
don't know how you're using them.
Thanks,
Seth Rowe

Regarding the anchor property -- I've set that (on a label) but it
doesn't seem to get configured at runtime. It doesn't anchor.

Can upload a screenshot in a bit -- basically though it's a lot of
labels. Some stretched to the size of the form while other "rows" may
have 2 or 3 labels in a panel.
Regarding the anchor property -- I've set that (on a label) but it
doesn't seem to get configured at runtime. It doesn't anchor.
On a new form the following works fine:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim l As New Label()
l.Text = "My Label"
l.Anchor = AnchorStyles.Bottom Or AnchorStyles.Right
Me.Controls.Add(l)
l.Location = New Point(150, 150)
End Sub

After you add that code drag out the bottom left corner of the form to
see the anchor property reposition the label. If you replace that code
with the following it will demonstrate how the anchor property can be
used to stretch a label:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim l As New Label()
l.Text = "My Label"
' Since the font won't increase, I changed
' the backcolor to demonstrate the effect better
l.BackColor = Color.Red
l.Anchor = AnchorStyles.Bottom Or AnchorStyles.Right Or
AnchorStyles.Top Or AnchorStyles.Left
Me.Controls.Add(l)
l.Location = New Point(150, 150)
End Sub

Thanks,

Seth Rowe

Jun 12 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Michel Joly de Lotbiniere | last post: by
4 posts views Thread by Eric Eggermann | last post: by
8 posts views Thread by knoxautoguy | last post: by
2 posts views Thread by Ola K | last post: by
1 post views Thread by =?Utf-8?B?RnJlZEM=?= | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.