VC # 2005 WinForm Development Experience (Original)

xiaoxiao2021-03-06  65

The pre-release version of the VS2005 has been downloaded. I tried it. I found a lot of new controls in System.Windows.Forms namespace. It provides convenient for WinForm programming. I will share my experience with you!

Web browser control

This control is a new control in 2005, using this control to write a browser quickly.

The control is described as an example of developing the control with a simple browser development.

First run Visual C # Express Click File, New, Project, select Windows Application to create a new project. Change the text attribute of Form1 as "My Browser". Add a ComboBox control to enter an URL. Another MAINMENU control is used to control, plus a button and change its text attribute to a connection. Finally, add a web browser control, change the Dock to none, change the anchor to Top, Bottom, Left, Right, change the Autorelocate property to true. (The interface is finally shown below)

Nowhere to all the original code

#Region Using Directives

Using system.collections.gener; using system.data; using system.drawing; using system.windows.form;

#ndregion

Namespace Web_Browser {Partial Class Form1: form {public form1 () {initializecomponent ();

Private void button_go_click (object sender, evenetargs e) {webbrowser1.navigate (ComboBoX1.SelectedItem.toString ());

}

Private Void Home ToolstripMenuItem_Click (Object Sender, Eventargs E) {WebBrowser1.gohome ();

Private void forward ToolstripMenuItem_Click (Object Sender, Eventargs E) {webbrowser1.goforward ();

}

Private Void Back ToolstripMenuItem_Click (Object Sender, Eventargs E) {webbrowser1.goback ();

}}}

It can be found that it is very convenient to use the Web Browser control to implement the browser through code.

2. ComboBox control

This control is added in 2005 to provide automatic completion. It provides three enumeration properties.

Enum autocompletemode {

None = 0x0;

AutoSuggest = 0x1;

AutoAppend = 0x2;

AutoSuggestAppend = 0x3;

}

3.Menustrip control

This control provides a fast picture insert (as shown), just click on the picture column on the left, thereby developing a desktop application with the same style as VS2005.

4.Datanavigator control

The DataNavigator control is used in detail the information in the database, and the property can quickly set up a professional interface soon.

转载请注明原文地址:https://www.9cbs.com/read-118828.html

New Post(0)