Presentation is loading. Please wait.

Presentation is loading. Please wait.

Windows Forms. Architecture Wrapper around WIN32API Part of the.NET Framework Code can be in C# or VB Toolbox has forms elements (buttons, etc.) Dragging.

Similar presentations


Presentation on theme: "Windows Forms. Architecture Wrapper around WIN32API Part of the.NET Framework Code can be in C# or VB Toolbox has forms elements (buttons, etc.) Dragging."— Presentation transcript:

1 Windows Forms

2 Architecture Wrapper around WIN32API Part of the.NET Framework Code can be in C# or VB Toolbox has forms elements (buttons, etc.) Dragging an element to the form creates a handler Add code to the handler

3 Creating a WF Application Start VS On the menu bar, choose File, New, Project. In the left pane, choose "Other Languages" Choose Visual Basic or Visual C#. In the middle pane (at top), choose the target framework (latest is.NET 4.5.1) In the middle pane choose Windows Forms Application

4 Navigation in VS Assuming your form is "Form1" Drag a control from the toolbox to the form Double-click on Form1.vb shows the form Click the drop down for Form1.vb Click on Form1 to see the code behind the form Controls can be dragged to the form VB is "supposed" to create template code you can modify This does not always work You may have to insert your own functions

5 Sample function Private Sub Num1_Click(ByVal S As System.Object, ByVal e As System.EventArgs) _ Handles Num1.TextChanged xs = Num1.Text 'MsgBox("input=" + xs) x = Val(xs) 'MsgBox("x=" + x.ToString) End Sub TextChanged can be set in properties Reserved word "end" is the final return


Download ppt "Windows Forms. Architecture Wrapper around WIN32API Part of the.NET Framework Code can be in C# or VB Toolbox has forms elements (buttons, etc.) Dragging."

Similar presentations


Ads by Google