WPF learning notes How to pass the value of the first login interface to the next page display: Animation series (iii)

Source: Internet
Author: User

... ...

Undertaking series (ii)

Before the login background has been set to send to the main interface:

Receive the value passed in the main interface:

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Windows;usingSystem.Windows.Controls;usingSystem.Windows.Data;usingSystem.Windows.Documents;usingSystem.Windows.Input;usingSystem.Windows.Media;usingSystem.Windows.Media.Imaging;usingSystem.Windows.Navigation;usingSystem.Windows.Shapes;usingSystem.Data.SqlClient;usingUser.sqlhelper;usingSystem.Data;usingSystem.IO;usingSystem.Drawing;namespaceuser{/// <summary>    ///the interactive logic of MainWindow.xaml/// </summary>     Public Partial classMainwindow:window { PublicMainWindow () {InitializeComponent (); }
      
     #region start from here . Public Static stringName =""; Private voidWindow_Loaded (Objectsender, RoutedEventArgs e) {Myhelper.showwarnmessage+=Newmyhelper.showwarnmessage (myhelper_showwarnmessage); } //user name to pass the login interfaceUser_test _u =Newuser_test (); voidMyhelper_showwarnmessage (string_str) { //Get user name string_msg =_str; //Pass the name to the main pageName = Tb_name. Text =_msg; //Get permissions based on user name #endregion ended up here . Public Static BOOLIsNew =false; //New When you nest another user Control 2 on the main page Private voidBtn_new_click (Objectsender, RoutedEventArgs e) { //isnew = true; ////New //Uc_item _ucitem = new Uc_item (); ////Set Number initialization //_ucitem.tb_id. Text = "0"; ////_ucitem. } Private voidBtn_nosolve_click (Objectsender, RoutedEventArgs e) { } Private voidBtn_solve_click (Objectsender, RoutedEventArgs e) { } }}

Which references the

myhelper.showwarnmessage + = new myhelper.showwarnmessage (myhelper_showwarnmessage);
The MyHelper.cs code has been http://www.cnblogs.com/Owen-ET/p/5999654.html here.

Result diagram:

At last:

WPF learning notes How to pass the value of the first login interface to the next page display: Animation series (iii)

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.