473,416 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

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 4499
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michel Joly de Lotbiniere | last post by:
I hope this is the correct newsgroup for this subject. The other day I came across a site www.safesquid.com that specified font-family:Terminal font-size:9pt in the inline css for command-line...
27
by: skeeterbug | last post by:
please see http://www.geocities.com/operationsengineer1/test.htm for an idea of how i want my logo header div to be layed out. when i went to resize "Test" to 2em (from 1em), this is what...
4
by: Eric Eggermann | last post by:
Hello all, I'm building an app that lays out and prints flash cards. Now the card might be any size, but when the user is working on the card, I draw the preview isotropically, as large as...
8
by: knoxautoguy | last post by:
This problem has consumed a lot of my time, and I'm aftraid someone will tell me that my whole approach to this objective is wrong; however, I would like to know if there is a way to do this. I...
2
by: Ola K | last post by:
Hi guys, I wrote a script that works *almost* perfectly, and this lack of perfection simply puzzles me. I simply cannot point the whys, so any help on it will be appreciated. I paste it all here,...
1
by: mudasserrafiq | last post by:
I am using following asp file default.asp <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <META http-equiv=Content-Type content="text/html; charset=windows-1252"> <META content="0...
1
by: =?Utf-8?B?RnJlZEM=?= | last post by:
When I add controls to a pocket PC form at design time, all the scaling works fine. I see in the initialize code the use of AutoScaleDeminsions and AutoScaleMode. However, when I add a control...
0
by: igalep132 | last post by:
Hey all, I was trying to resize control size to the form size. I'm changing my form size according to current Screen Size by using Screen.PrimaryScreen.WorkingArea; and then I'm making a...
1
by: praveenb000 | last post by:
Hi every one, I designed a web page, having horizontal menu using UL and LI tags; I need to be set rollover effect for a menu items. whenever user hover on a menu item, the entire...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.