熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

C#高級編程:數據綁定對象[3]

2022-06-13   來源: .NET編程 
    ——此文章摘自《C#高級編程(第版)》定價元 特價元 購買

    ScrollingDataBinding示例的代碼如下所示
    using System;
    using SystemWindowsForms;
    using SystemData;
    using SystemDataSqlClient;       
    public class ScrollingDataBinding : SystemWindowsFormsForm
    {
       private Button retrieveButton;
       private TextBox textName;
       private TextBox textQuan;
       private TrackBar trackBar;
       private DataSet ds;

    應用程序在ScrollingDataBinding構造函數中創建窗口以及該窗口中的所有控件
       public ScrollingDataBinding()
       {
          thisAutoScaleBaseSize = new SystemDrawingSize( );
          thisClientSize = new SystemDrawingSize( );
          thisText = _ScrollingDataBinding;
          thisretrieveButton = new Button();
          retrieveButtonLocation = new SystemDrawingPoint( );
          retrieveButtonSize = new SystemDrawingSize( );
          retrieveButtonTabIndex = ;
          retrieveButtonAnchor = AnchorStylesTop | AnchorStylesLeft;
          retrieveButtonText = Retrieve;

          retrieveButtonClick += new SystemEventHandler
                                     (thisretrieveButton_Click);
          thisControlsAdd(thisretrieveButton);
          thistextName = new TextBox();
          textNameLocation = new SystemDrawingPoint( );
          textNameText = Please click retrieve;
          textNameTabIndex = ;
          textNameAnchor = AnchorStylesTop | AnchorStylesLeft |
                            AnchorStylesRight ;
          textNameSize = new SystemDrawingSize( );
          textNameEnabled = false;
          thisControlsAdd(thistextName);
          thistextQuan = new TextBox();
          textQuanLocation = new SystemDrawingPoint( );
          textQuanText = ;
          textQuanTabIndex = ;

[]  []  []  []  


From:http://tw.wingwit.com/Article/program/net/201311/15548.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.