窗户形成第二种形式bedut [英] windows form 2nd form bedut

查看:234
本文介绍了窗户形成第二种形式bedut的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在创建Windows应用程序,我需要2个表格

现在我在表单1中设计并且表单2



如果我执行表格1会出现但是form2没有出现



i设置属性但是在启动对象中没有表格显示

我是什么将执行程序

Hi I am creating windows application, i take 2 forms
now i am design in form 1 and form 2

if i execute form 1 will appear but form2 not appearing

i set the property but there in startup object no forms displaying
what i will do to execute the program

推荐答案

您可以在program.cs文件中更改启动页面
you can change start up page in program.cs file


添加两个窗口表单你的项目如Form1和Form2



使form1成为一个启动表单


$ 1 $ b在Form1加载函数调用中Form2.Show



add two window forms in your project like Form1 and Form2

make the form1 as a startup form

in Form1 load function call Form2.Show

Public Class Form1

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Form2.Show()

    End Sub
End Class




$ 2 $ b在Form2加载函数中,添加以下代码以并排显示表单。我使用的表单大小为300,300





in Form2 load function, add the below code to show the forms side by side. i used the form size as 300,300

Public Class Form2

    Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Me.Location = New Point(Form1.Location.X + Form1.Width + 10, Form1.Location.Y)

    End Sub
End Class


这篇关于窗户形成第二种形式bedut的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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