Share vb.net open new form

ngovuclint

New member
### Cách mở biểu mẫu mới trong vb.net

**Tổng quan**

Trong hướng dẫn này, bạn sẽ học cách mở một biểu mẫu mới trong vb.net.Bạn sẽ tìm hiểu cách tạo một biểu mẫu mới, thêm các điều khiển vào biểu mẫu và sau đó mở biểu mẫu.

** Điều kiện tiên quyết **

Để làm theo hướng dẫn này, bạn sẽ cần những điều sau đây:

* Visual Studio 2019 trở lên
* Một sự hiểu biết cơ bản về vb.net

** Tạo một biểu mẫu mới **

Để tạo một biểu mẫu mới, hãy mở Visual Studio và chọn tệp **> New> Project **.Trong hộp thoại ** mới **, chọn ứng dụng ** Windows Forms ** và nhấp vào ** OK **.

Điều này sẽ tạo ra một dự án Windows Forms mới.Trong Giải pháp Explorer, bấm chuột phải vào tên dự án và chọn ** Thêm> Biểu mẫu Windows **.Điều này sẽ tạo ra một hình thức mới trong dự án.

** Thêm điều khiển vào biểu mẫu **

Để thêm các điều khiển vào biểu mẫu, bấm đúp vào biểu mẫu trong trình thám hiểm giải pháp.Điều này sẽ mở biểu mẫu trong nhà thiết kế.

Bạn có thể thêm các điều khiển vào biểu mẫu bằng cách kéo chúng từ hộp công cụ ** ** vào biểu mẫu.Khi bạn đã thêm các điều khiển vào biểu mẫu, bạn có thể định cấu hình các thuộc tính của chúng trong cửa sổ ** Thuộc tính **.

** Mở biểu mẫu **

Để mở biểu mẫu, bạn có thể sử dụng phương thức ** show **.Mã sau đây cho thấy cách mở biểu mẫu có tên `form1`:

`` `VBNet
Form1.show ()
`` `

Bạn cũng có thể mở một biểu mẫu bằng cách sử dụng phương thức ** showDialog **.Mã sau đây cho thấy cách mở biểu mẫu có tên `form1` làm hộp thoại:

`` `VBNet
Form1.showdialog ()
`` `

**Phần kết luận**

Trong hướng dẫn này, bạn đã học cách mở một biểu mẫu mới trong vb.net.Bạn đã học cách tạo một biểu mẫu mới, thêm các điều khiển vào biểu mẫu và sau đó mở biểu mẫu.

### hashtags

* #vb.net
* #Windows Forms
* #các hình thức
* Mẫu #open
* #Show Mẫu
=======================================
### How to Open a New Form in VB.NET

**Overview**

In this tutorial, you will learn how to open a new form in VB.NET. You will learn how to create a new form, add controls to the form, and then open the form.

**Prerequisites**

To follow this tutorial, you will need the following:

* Visual Studio 2019 or later
* A basic understanding of VB.NET

**Creating a New Form**

To create a new form, open Visual Studio and select **File > New > Project**. In the **New Project** dialog box, select **Windows Forms Application** and click **OK**.

This will create a new Windows Forms project. In the Solution Explorer, right-click the project name and select **Add > Windows Form**. This will create a new form in the project.

**Adding Controls to the Form**

To add controls to the form, double-click the form in the Solution Explorer. This will open the form in the designer.

You can add controls to the form by dragging them from the **Toolbox** onto the form. Once you have added the controls to the form, you can configure their properties in the **Properties** window.

**Opening the Form**

To open the form, you can use the **Show** method. The following code shows how to open a form named `Form1`:

```vbnet
Form1.Show()
```

You can also open a form by using the **ShowDialog** method. The following code shows how to open a form named `Form1` as a dialog box:

```vbnet
Form1.ShowDialog()
```

**Conclusion**

In this tutorial, you learned how to open a new form in VB.NET. You learned how to create a new form, add controls to the form, and then open the form.

### Hashtags

* #vb.net
* #Windows Forms
* #Forms
* #open Form
* #Show Form
 
Join Telegram ToolsKiemTrieuDoGroup
Back
Top