zoukankan      html  css  js  c++  java
  • vc6设置控件的值

    文本输入框

    // DlgTest2.cpp : implementation file
    //
    
    #include "stdafx.h"
    #include "Text.h"
    #include "DlgTest2.h"
    
    #ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif
    
    /////////////////////////////////////////////////////////////////////////////
    // CDlgTest2 dialog
    
    
    CDlgTest2::CDlgTest2(CWnd* pParent /*=NULL*/)
    	: CDialog(CDlgTest2::IDD, pParent)
    {
    	//{{AFX_DATA_INIT(CDlgTest2)
    	m_strEdit1 = _T("");
    	//}}AFX_DATA_INIT
    }
    
    
    void CDlgTest2::DoDataExchange(CDataExchange* pDX)
    {
    	CDialog::DoDataExchange(pDX);
    	//{{AFX_DATA_MAP(CDlgTest2)
    	DDX_Text(pDX, IDC_EDIT1, m_strEdit1);
    	//}}AFX_DATA_MAP
    }
    
    
    BEGIN_MESSAGE_MAP(CDlgTest2, CDialog)
    	//{{AFX_MSG_MAP(CDlgTest2)
    	ON_BN_CLICKED(IDC_NUMBER_DLG2_LABEL1, OnLABEL1_CLICK)
    	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
    	ON_BN_CLICKED(IDC_BUTTON2, OnBtn2_Click)
    	ON_BN_CLICKED(IDC_LABEL2, On_Label2_CLICK)
    	ON_BN_CLICKED(IDC_BUTTON3, On_Btn3_GetEdit1Value)
    	ON_BN_CLICKED(IDC_BUTTON4, On_BTN4_SetEdit1Value)
    	//}}AFX_MSG_MAP
    END_MESSAGE_MAP()
    
    /////////////////////////////////////////////////////////////////////////////
    // CDlgTest2 message handlers
    
    void CDlgTest2::OnLABEL1_CLICK() 
    {
    	MessageBox("hello谢谢点击");	
    }
    
    void CDlgTest2::OnButton1() 
    {
    	// TODO: Add your control notification handler code here
    	MessageBox("hello谢谢点击Button");
    }
    
    void CDlgTest2::OnBtn2_Click() 
    {
    	CString str;
    	((CEdit*)this->GetDlgItem(IDC_EDIT1))->GetWindowText(str);
    	MessageBox(str);
    }
    
    void CDlgTest2::On_Label2_CLICK() 
    {
    	MessageBox("LABEL2 clicked");
    	
    }
    
    void CDlgTest2::On_Btn3_GetEdit1Value() 
    {
    	UpdateData();
    	MessageBox(this->m_strEdit1);
    }
    
    void CDlgTest2::On_BTN4_SetEdit1Value() 
    {
    	this->m_strEdit1="吴xx";
    	UpdateData(FALSE);
    }
    
    

    http://hi.baidu.com/hushaobo_km/blog/item/d4f0b12d114e673f359bf77e.html

  • 相关阅读:
    Spring RestTemplate详解(转载)
    单点登录之CAS原理和实现(转载)
    Redis集群的原理和搭建(转载)
    50道Kafka面试题和解析(转载)
    阿里P8架构师谈:Restful、SOAP、RPC、SOA、微服务之间的区别(转载)
    定期喝鸡汤
    Cassandra的架构
    Cassandra的数据模型
    Summary of OAuth 2.0
    林森
  • 原文地址:https://www.cnblogs.com/wucg/p/1949775.html
Copyright © 2011-2022 走看看