在vb.net中更改窗口应用程序中的表单大小 [英] changing form size in window app in vb.net

查看:108
本文介绍了在vb.net中更改窗口应用程序中的表单大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在触发form_load事件时更改表单大小,
默认大小为900,700,我想根据系统类型进行更改
另一个大小是700,500

当前代码
在应用程序配置中:< pre lang ="C ++">& lt; add key =& quot; SystemType& quot; value =& quot; 1或2& quot; /& gt;</pre>


< pre>私人Sub EmplTimeCard_Load(ByVal发送者为对象,ByVal e为System.EventArgs)处理Me.Load
如果SystemType = 1,则
''ScreenResolution()
Me.Size =新尺寸(700,500)
如果结束

结束Sub</pre>

问题是应用程序配置中出现错误,并且大小未更改,显示为
1024,724

请帮助我

我已经用您发送的解决方案更新了我的代码
仍然面临问题
尺寸形式没有变化
请发送新代码以更改表格大小
根据系统.

[edit]已添加代码块,忽略HTML ..."选项已禁用-OriginalGriff [/edit]

I want to change the form size when form_load event fires,
the default size is 900,700 i want to change according to system type
the another size is 700,500

the present code
In app config:<pre lang="C++">&lt;add key=&quot;SystemType&quot; value=&quot;1 or 2&quot; /&gt;</pre>


<pre>Private Sub EmplTimeCard_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If SystemType = 1 Then
''ScreenResolution()
Me.Size = New Size(700, 500)
End If

End Sub</pre>

The problem is error in app config and the size was not changing it showing
1024,724

please help me

i have updated my code with the solution you has sent
still im facing problem
the size form is not changing
please send new code that the form size shoulb be change
according to system.

[edit]Code block added, "Ignore HTML..." option disabled - OriginalGriff[/edit]

推荐答案

您的应用配置文件显示SystemType为"1或2.
您的测试将SystemType与"1"进行比较.

1与"1或2"不同.

因此,您的测试将失败,并且您将不会更改屏幕的大小.

尝试更改一下:
Your app config file shows the SystemType is "1 or 2".
Your test compares SystemType with "1".

1 is not the same as "1 or 2".

Therefore your test will fail, and you will not change the size of the screen.

Try changing it a bit:
<add key="SystemType" value="Type1" />


Private Sub EmplTimeCard_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If SystemType = "Type1" Then
                'ScreenResolution()
                Me.Size = New Size(700, 500)
            End If

End Sub


您应该可以从那里解决问题...:笑:


You should be able to work it out from there...:laugh:


这篇关于在vb.net中更改窗口应用程序中的表单大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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