473,394 Members | 1,694 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,394 software developers and data experts.

How to resize a form

tim
VB 6: frame1.width = form1.width - 200
VB .NET: ?

Can someone please help with this simple line of code...thanks..
Nov 21 '05 #1
10 1661
Jay
The size properties are the same as VB6.
Additionally, there's a "size" property that you can set all the size
attributes at once.

Isn't your code working this way?

-Jay
"tim" <ti*@hello.com> escreveu na mensagem
news:WC***********@fe2.columbus.rr.com...
VB 6: frame1.width = form1.width - 200
VB .NET: ?

Can someone please help with this simple line of code...thanks..

Nov 21 '05 #2
tim
No, it doesn't seem to work. form1 doesn't seem to have a property of
'width'. Looks like it's underneath the size property, but not sure what
the syntax of the code is.

"Jay" <.> wrote in message news:eS**************@TK2MSFTNGP09.phx.gbl...
The size properties are the same as VB6.
Additionally, there's a "size" property that you can set all the size
attributes at once.

Isn't your code working this way?

-Jay
"tim" <ti*@hello.com> escreveu na mensagem
news:WC***********@fe2.columbus.rr.com...
VB 6: frame1.width = form1.width - 200
VB .NET: ?

Can someone please help with this simple line of code...thanks..


Nov 21 '05 #3
Jay
Is your form instantiated?
VB.NET doesn't have that "default instance" of objects like VB6...
"tim" <ti*@hello.com> escreveu na mensagem
news:36*************@fe2.columbus.rr.com...
No, it doesn't seem to work. form1 doesn't seem to have a property of
'width'. Looks like it's underneath the size property, but not sure what
the syntax of the code is.

"Jay" <.> wrote in message news:eS**************@TK2MSFTNGP09.phx.gbl...
The size properties are the same as VB6.
Additionally, there's a "size" property that you can set all the size
attributes at once.

Isn't your code working this way?

-Jay
"tim" <ti*@hello.com> escreveu na mensagem
news:WC***********@fe2.columbus.rr.com...
VB 6: frame1.width = form1.width - 200
VB .NET: ?

Can someone please help with this simple line of code...thanks..



Nov 21 '05 #4
Tim,
No, it doesn't seem to work. Forms have a Width property, its inherited from Control.

http://msdn.microsoft.com/library/de...widthtopic.asp

For information on Resizing Windows Forms see:

http://msdn.microsoft.com/library/de...sizingform.asp

Hope this helps
Jay

"tim" <ti*@hello.com> wrote in message
news:36*************@fe2.columbus.rr.com... No, it doesn't seem to work. form1 doesn't seem to have a property of
'width'. Looks like it's underneath the size property, but not sure what
the syntax of the code is.

"Jay" <.> wrote in message news:eS**************@TK2MSFTNGP09.phx.gbl...
The size properties are the same as VB6.
Additionally, there's a "size" property that you can set all the size
attributes at once.

Isn't your code working this way?

-Jay
"tim" <ti*@hello.com> escreveu na mensagem
news:WC***********@fe2.columbus.rr.com...
VB 6: frame1.width = form1.width - 200
VB .NET: ?

Can someone please help with this simple line of code...thanks..



Nov 21 '05 #5
tim
I'm guessing not since I'm not sure what instantiated is

"Jay" <.> wrote in message news:Oq**************@TK2MSFTNGP09.phx.gbl...
Is your form instantiated?
VB.NET doesn't have that "default instance" of objects like VB6...
"tim" <ti*@hello.com> escreveu na mensagem
news:36*************@fe2.columbus.rr.com...
No, it doesn't seem to work. form1 doesn't seem to have a property of
'width'. Looks like it's underneath the size property, but not sure what
the syntax of the code is.

"Jay" <.> wrote in message news:eS**************@TK2MSFTNGP09.phx.gbl...
The size properties are the same as VB6.
Additionally, there's a "size" property that you can set all the size
attributes at once.

Isn't your code working this way?

-Jay
"tim" <ti*@hello.com> escreveu na mensagem
news:WC***********@fe2.columbus.rr.com...
VB 6: frame1.width = form1.width - 200
VB .NET: ?

Can someone please help with this simple line of code...thanks..



Nov 21 '05 #6
"tim" <ti*@hello.com> schrieb:
VB 6: frame1.width = form1.width - 200
VB .NET: ?


In addition to the other replies: Notice that VB.NET supports docking and
anchoring of controls (properties 'Anchor' and 'Dock') which make explicit
resize code unnecessary in most cases.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #7
"tim" <ti*@hello.com> wrote in message
news:WC***********@fe2.columbus.rr.com...
VB 6: frame1.width = form1.width - 200
VB .NET: ?


Private Sub Form_Layout( ... ) Handles Form1.Layout
Me.Frame1.Width = Me.ClientSize.Width - 13 ' roughly
End Sub

Forms have an overall Size (including borders and title bar) and
a ClientSize, that just includes the "inner" bit that you can
[normally] play with.

Your 200 has shrunk to 13 because all measurements in VB.Net
are now in Pixels; Twips are dead and buried (and good riddance),
so all your offsets, like this, need to be 1/15th their previous size
(Screen.TwipsPerPixelX/Y notwithstanding).

HTH,
Phill W.
Nov 21 '05 #8
Tim,

I did not see it in thrhead

frame1.width = me.width - 200

I hope this helps?

Cor
Nov 21 '05 #9
Addendum:

I forgot to say that it's a bad idea to base control sizes on the form's
width, because this width includes the width of the borders which may vary
from system to system. Instead, base the controls' sizes on the client size
of the form ('Me.ClientSize.Width').

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #10
tim
Ding...Ding....Phill is the man...

Phills reply worked perfect.
"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:d0**********@yarrow.open.ac.uk...
"tim" <ti*@hello.com> wrote in message
news:WC***********@fe2.columbus.rr.com...
VB 6: frame1.width = form1.width - 200
VB .NET: ?


Private Sub Form_Layout( ... ) Handles Form1.Layout
Me.Frame1.Width = Me.ClientSize.Width - 13 ' roughly
End Sub

Forms have an overall Size (including borders and title bar) and
a ClientSize, that just includes the "inner" bit that you can
[normally] play with.

Your 200 has shrunk to 13 because all measurements in VB.Net
are now in Pixels; Twips are dead and buried (and good riddance),
so all your offsets, like this, need to be 1/15th their previous size
(Screen.TwipsPerPixelX/Y notwithstanding).

HTH,
Phill W.

Nov 21 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rob Richardson | last post by:
Greetings! I have a form with a listview, a menu, and a few text boxes, labels and command buttons. I want to resize the listview when the form is resized to that the widths of the spaces...
8
by: nirdeshonline | last post by:
Hi, I have added a simple listbox in windows form under c# 2.0. It contains a collection of approx 10 strings as list items. Now when i resize the form whole listbox flickers. Please tell me...
11
by: Ajith Menon | last post by:
I have created a windows application in which the form needs to be resized on the MouseMove event. The windows resize function takes a lot of CPU cycles. And as the resize function is called on the...
2
by: Smitty | last post by:
Did a search & found nothing on this. VB6 did a resize on form load according to what I've read. I Resized screen under vista & now the text box doesn't resize to form's clientarea. Code exists...
1
by: Bob Alston | last post by:
I have a system where many subforms are used. Often the size of the subform had to be larger than could be displayed without scrolling. I set the height of the subform to the typical height...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.