By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,423 Members | 1,601 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,423 IT Pros & Developers. It's quick & easy.

RunTime Control Anchor & Font Scaling

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.