Liam's C # learning Journey (vii): WPF (Windows Presentation Foundation), Windows Form applications

Source: Internet
Author: User

In today's class, the teacher tells us about some of the WPF (Windows Presentation Foundation) and Windows Form applications, so let's review it together:

(i), WPF (Windows Presentation Foundation):

WPF is an important application for desktop mobile phone development. It uses a variant of the XML Language--xaml language (extensible Application Markup Language).

With XAML developers, all user interface elements of a WPF program, such as text, buttons, images, list boxes, and so on, can be set up in detail, while the entire interface can be rationalized for layout, much like using HTML. However, because XAML is XML-based, it is itself a well-organized XML document, and its syntax is more rigorous and unambiguous relative to HTML. It is expected that most of the XAML will be automatically generated by the corresponding software, just as we are now making a static page with almost no HTML code to produce an aesthetically pleasing page directly from the Dreamweaver software.

In the extracurricular, I again through Bob Tabor's C # teaching video, more in-depth study of some of the XAML program, through these video explanation, we can understand more deeply understanding, below is a simple example and its output result:

1x:class="Gridsrowsandcolumns.mainpage"2xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"3xmlns:x="Http://schemas.microsoft.com/winfx/2006/xaml"4Xmlns:local="Using:gridsrowsandcolumns"5Xmlns:d="http://schemas.microsoft.com/expression/blend/2008"6Xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"7mc:ignorable="D"8Background="{ThemeResource Applicationpagebackgroundthemebrush}">9 Ten<Page.Resources> One<style targettype="TextBlock"> A<setter property="FontSize"Value=" the"/> -</Style> -</Page.Resources> the  -<Grid> -<Grid.RowDefinitions> -<rowdefinition height="*"/> +<rowdefinition height="*"/> -<rowdefinition height="*"/> +</Grid.RowDefinitions> A<Grid.ColumnDefinitions> at<columndefinition width="*"/> -<columndefinition width="*"/> -<columndefinition width="*"/> -</Grid.ColumnDefinitions> -  -<TextBlock>1</TextBlock> in<textblock grid.column="1">2</TextBlock> -<textblock grid.column="2">3</TextBlock> to  +<textblock grid.row="1">4</TextBlock> -<textblock grid.row="1"grid.column="1">5</TextBlock> the<textblock grid.row="1"grid.column="2">6</TextBlock> *  $<textblock grid.row="2">7</TextBlock>Panax Notoginseng<textblock grid.row="2"grid.column="1">8</TextBlock> -<textblock grid.row="2"grid.column="2">9</TextBlock> the  +</Grid> A</Page>

Output Result:

  

(b), Windows Form applications:

In fact, before the teacher to explain this chapter, we are writing crc_generation in the use of this aspect of the content, let me through this program to review the relevant content:

I wrote the following code:

usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;namespacecrc_generation_form{ Public Partial classForm1:form { PublicForm1 () {InitializeComponent (); Registerbox.readonly=true; }        Private voidokButton_Click (Objectsender, EventArgs e) {System.Diagnostics.Process P=NewSystem.Diagnostics.Process (); stringDebugaddress =environment.currentdirectory; p.StartInfo.FileName= Debugaddress +"\\CRC_Generation.exe"; P.startinfo.useshellexecute=false; P.startinfo.createnowindow=true; P.startinfo.arguments=Pathbox.text; P.startinfo.redirectstandardoutput=true; P.startinfo.redirectstandarderror=true; P.startinfo.redirectstandardinput=true;            P.start ();            OUTPUTBOX.ITEMS.ADD (P.standardoutput.readtoend ()); //pathbox.value = "";         }    }}

This is mainly the Ok_button of the Click event to write the content, through the process statement with the external pre-written console program connected, and the output is redirected to the Outputbox in the form, the output is as follows:

(Error input)

(correct input)

Liam's C # learning Journey (vii): WPF (Windows Presentation Foundation), Windows Form applications

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.