更改表单高度语法 [英] Change form height syntax

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

问题描述

我有一个表单,我希望在代码中更改高度。我会有

假设下面的东西会起作用但不会:


Me.Size.Height = 292


我得到表达是一个值,因此不能成为

asignment的目标


我缺少什么?

I have a form who''s height I would like to change in code. I would have
supposed something like the following would work but it does not:

Me.Size.Height = 292

I get "Expression is a value and therefore can not be the target of an
asignment"

What am I missing?

推荐答案

大小是一个类,而不是一个简单的结构。请尝试以下方法之一:


Me.Height = 292



Me.Size = new Size(Me.Size 。宽度,292)

-----

Rafael Pivato

" Woody Splawn" < WO *** @ splawns.com> escreveu na mensagem

新闻:e0 ************* @ TK2MSFTNGP10.phx.gbl ...
Size is a class, not a simple structure. Try one of the following:

Me.Height = 292
or
Me.Size = new Size(Me.Size.Width, 292)
-----
Rafael Pivato
"Woody Splawn" <wo***@splawns.com> escreveu na mensagem
news:e0*************@TK2MSFTNGP10.phx.gbl...
我有一个表格'高度我想在代码中改变。我会认为以下内容会起作用,但事实并非如此:

Me.Size.Height = 292

我得到表达是一种价值因此不能成为
asignment的目标

我缺少什么?
I have a form who''s height I would like to change in code. I would have
supposed something like the following would work but it does not:

Me.Size.Height = 292

I get "Expression is a value and therefore can not be the target of an
asignment"

What am I missing?



Woody Splawn < WO *** @ splawns.com> scripsit:
"Woody Splawn" <wo***@splawns.com> scripsit:
我有一个表格,我希望在代码中更改高度。我会认为以下内容会起作用,但事实并非如此:

Me.Size.Height = 292

我得到表达是一种价值因此不能成为
asignment的目标
I have a form who''s height I would like to change in code. I would have
supposed something like the following would work but it does not:

Me.Size.Height = 292

I get "Expression is a value and therefore can not be the target of an
asignment"




请改用Me.Height = 292。

-

Herfried K. Wagner

MVP·VB Classic,VB.NET

< http:// www .mvps.org / dotnet>



Use ''Me.Height = 292'' instead.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>


Hi Woody,


Size的文档说明你可以获取或设置宽度和

高度,这是完全合理的。它没有说的是,当它是一个控件的大小时,你不能>

!您缺少的信息是提供信息

文件!!


您可以创建一个新的尺寸并一次性分配。

Me.Size =新尺寸(Me.Size.Width,292)


但是说嗯更容易!到大小,只是为了高度


Me.Height = 292. ;-))

问候,

Fergus。
Hi Woody,

The documentation for Size says that you can get or set the Width and
Height, which is entirely reasonable. What it doesn''t say is that you <can''t>
when it''s the Size of a Control!! The bit you''re missing is informative
documentation!!

You can create a new Size and assign it in one go.
Me.Size = New Size (Me.Size.Width, 292)

But it''s easier to say Huh! to the Size and just go for the Height

Me.Height = 292. ;-))

Regards,
Fergus.


这篇关于更改表单高度语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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