表格大小??? [英] Form size ???

查看:68
本文介绍了表格大小???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前的屏幕分辨率设置为1024 x 768.我的表单大小始终为

up 1032 x 748.


我试过了帮助样本

''使用PrimaryScreen和WorkingArea属性从Screen类中检索工作矩形

''

Dim workingRectangle As System。 Drawing.Rectangle = _

Screen.PrimaryScreen.WorkingArea


''设置表单大小略小于

''工作矩形。

Me.Size = New System.Drawing.Size(workingRectangle.Width,_

workingRectangle.Height)


''设置位置以便整个表单可见。

Me.Location =新System.Drawing.Point(0,0)


workingRectangle的格式为1024 x 740.Me.Size的格式为1032 x

748,位置为-4 x -4


它没有无论StartPosition和AutoSize设置为什么。给出了什么?


我正在尝试使用表格宽度根据宽度将绘图面板(PictDraw)设置为

最大宽度是4的倍数。我想我将

必须使用以下

代码中的SystemDrawing.Size(workingRectangle.Width)。表格保证金设置为单一。


指数= Me.Width - 2

指数= Int(指数/ 4)

指数=指数* 4

gScreen.HorPixels =指数

使用PictDraw

X1Y1.X = Int(Int((Me.Width - 索引))/ 2)

X1Y1.Y = 0

。位置= X1Y1

X2Y2.X = gScreen.HorPixels

X2Y2.Y = 450

.Size = X2Y2

结束


关于表格原因的任何想法总是出现1032 X748?


GalenS

My current screen resolution is set to 1024 x 768. My form size always comes
up as 1032 x 748.

I have tried the help sample
'' Retrieve the working rectangle from the Screen class
'' using the PrimaryScreen and the WorkingArea properties.
Dim workingRectangle As System.Drawing.Rectangle = _
Screen.PrimaryScreen.WorkingArea

'' Set the size of the form slightly less than size of
'' working rectangle.
Me.Size = New System.Drawing.Size(workingRectangle.Width, _
workingRectangle.Height)

'' Set the location so the entire form is visible.
Me.Location = New System.Drawing.Point(0, 0)

the workingRectangle comes up as 1024 x 740. the Me.Size comes up as 1032 x
748 and location as -4 x -4

It doesn''t matter what the StartPosition and AutoSize is set to. What gives?

I''m trying to use the Form Width to set a drawing Panel (PictDraw) to the
maximum width based on the the width being a multiple of 4. I guess I''ll
have to use the SystemDrawing.Size(workingRectangle.Width) in the following
code. The Form margin is set to Single.

Index = Me.Width - 2
Index = Int(Index / 4)
Index = Index * 4
gScreen.HorPixels = Index
With PictDraw
X1Y1.X = Int(Int((Me.Width - Index) ) / 2)
X1Y1.Y = 0
.Location = X1Y1
X2Y2.X = gScreen.HorPixels
X2Y2.Y = 450
.Size = X2Y2
End With

Any ideas as to why the form always comes up 1032 X748 ?

GalenS

推荐答案

您应该考虑将位置设置为位置工作

区域矩形,否则您的表单可能无法在桌面上正确显示

任务栏位于顶部或左侧边缘。例如


位置= workingRectangle.Location

大小= workingRectangle.Size


什么时候是设置大小叫?它是在

InitializeComponent之后调用的吗?你可以尝试处理表单的LocationChanged和

SizeChanged事件,看看当你的代码

设置属性时它们是否被引发。可能是其他一些代码在你之后更改了

属性,这意味着你会看到再次引发的事件。


-

Kevin Westhead


" Galen Somerville" < GA *** @ community.nospam>在消息中写道

news:e8 ************** @ TK2MSFTNGP12.phx.gbl ...
You should consider setting the location to be the location of the working
area rectangle, otherwise your form might not display properly on desktops
where the taskbar is along either the top or left edges. E.g.

Location = workingRectangle.Location
Size = workingRectangle.Size

When is the code that sets the size called? Is it called after
InitializeComponent? You could try handling the LocationChanged and
SizeChanged events of the form and see if they are raised when your code
sets the properties. It could be that some other code is changing the
properties after you, which means you''ll see the events raised again.

--
Kevin Westhead

"Galen Somerville" <ga***@community.nospam> wrote in message
news:e8**************@TK2MSFTNGP12.phx.gbl...
我当前的屏幕分辨率是设置为1024 x 768.我的表单大小始终为1032 x 748.

我已经尝试了帮助示例
''从Screen类中检索工作矩形
''使用PrimaryScreen和WorkingArea属性。
Dim workingRectangle As System.Drawing.Rectangle = _
Screen.PrimaryScreen.WorkingArea

''设置大小形状略小于
''工作矩形的大小。
Me.Size = New System.Drawing.Size(workingRectangle.Width,_
workingRectangle.Height)

''设置位置以便整个表单可见。
Me.Location = New System.Drawing.Point(0,0)



workRectangle的格式为1024 x 740。 Me.Size出现为1032
x 748,位置为-4 x -4
将StartPosition和AutoSize设置为什么并不重要。
给出了什么?

< snip>
My current screen resolution is set to 1024 x 768. My form size always
comes up as 1032 x 748.

I have tried the help sample
'' Retrieve the working rectangle from the Screen class
'' using the PrimaryScreen and the WorkingArea properties.
Dim workingRectangle As System.Drawing.Rectangle = _
Screen.PrimaryScreen.WorkingArea

'' Set the size of the form slightly less than size of
'' working rectangle.
Me.Size = New System.Drawing.Size(workingRectangle.Width, _
workingRectangle.Height)

'' Set the location so the entire form is visible.
Me.Location = New System.Drawing.Point(0, 0)

the workingRectangle comes up as 1024 x 740. the Me.Size comes up as 1032
x 748 and location as -4 x -4

It doesn''t matter what the StartPosition and AutoSize is set to. What
gives?

<snip>



也许你的表格'的最小尺寸设置为?..有一个属性

最小尺寸..检查......


VJ


Galen Somerville < GA *** @ community.nospam>在消息中写道

news:e8 ************** @ TK2MSFTNGP12.phx.gbl ...
Maybe your Form''s Minimum size is set to that?.. there is a property for
Minimum size.. check that...

VJ

"Galen Somerville" <ga***@community.nospam> wrote in message
news:e8**************@TK2MSFTNGP12.phx.gbl...
我当前的屏幕分辨率是设置为1024 x 768.我的表单大小始终为1032 x 748.

我已经尝试了帮助示例
''从Screen类中检索工作矩形
''使用PrimaryScreen和WorkingArea属性。
Dim workingRectangle As System.Drawing.Rectangle = _
Screen.PrimaryScreen.WorkingArea

''设置大小形状略小于
''工作矩形的大小。
Me.Size = New System.Drawing.Size(workingRectangle.Width,_
workingRectangle.Height)

''设置位置以便整个表单可见。
Me.Location = New System.Drawing.Point(0,0)



workRectangle的格式为1024 x 740。 Me.Size出现为1032
x 748,位置为-4 x -4
将StartPosition和AutoSize设置为什么并不重要。

我正在尝试使用表格宽度将绘图面板(PictDraw)设置为
最大宽度,基于宽度为倍数的倍数4.我想我必须在
下面的代码中使用SystemDrawing.Size(workingRectangle.Width)。表格边距设置为单一。

指数= Me.Width - 2
指数= Int(指数/ 4)
指数=指数* 4
gScreen。 HorPixels =索引
使用PictDraw
X1Y1.X = Int(Int((Me.Width - Index))/ 2)
X1Y1.Y = 0
.Location = X1Y1
X2Y2.X = gScreen.HorPixels
X2Y2.Y = 450
。尺寸= X2Y2
结束

任何想法,为什么表格总是来1032 X748?

GalenS
My current screen resolution is set to 1024 x 768. My form size always
comes up as 1032 x 748.

I have tried the help sample
'' Retrieve the working rectangle from the Screen class
'' using the PrimaryScreen and the WorkingArea properties.
Dim workingRectangle As System.Drawing.Rectangle = _
Screen.PrimaryScreen.WorkingArea

'' Set the size of the form slightly less than size of
'' working rectangle.
Me.Size = New System.Drawing.Size(workingRectangle.Width, _
workingRectangle.Height)

'' Set the location so the entire form is visible.
Me.Location = New System.Drawing.Point(0, 0)

the workingRectangle comes up as 1024 x 740. the Me.Size comes up as 1032
x 748 and location as -4 x -4

It doesn''t matter what the StartPosition and AutoSize is set to. What
gives?

I''m trying to use the Form Width to set a drawing Panel (PictDraw) to the
maximum width based on the the width being a multiple of 4. I guess I''ll
have to use the SystemDrawing.Size(workingRectangle.Width) in the
following code. The Form margin is set to Single.

Index = Me.Width - 2
Index = Int(Index / 4)
Index = Index * 4
gScreen.HorPixels = Index
With PictDraw
X1Y1.X = Int(Int((Me.Width - Index) ) / 2)
X1Y1.Y = 0
.Location = X1Y1
X2Y2.X = gScreen.HorPixels
X2Y2.Y = 450
.Size = X2Y2
End With

Any ideas as to why the form always comes up 1032 X748 ?

GalenS



" Galen Somerville" < GA *** @ community.nospam> schrieb:
"Galen Somerville" <ga***@community.nospam> schrieb:
我当前的屏幕分辨率设置为1024 x 768.我的表单大小总是
为1032 x 748.
My current screen resolution is set to 1024 x 768. My form size always
comes up as 1032 x 748.




表格'不能大于桌面的工作区。


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB< URL:http://classicvb.org/petition/>



Form''s cannot be larger than the desktop''s working area.

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


这篇关于表格大小???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆