vc6設定控制項的值

來源:互聯網
上載者:User

文本輸入框

 

// DlgTest2.cpp : implementation file//#include "stdafx.h"#include "Text.h"#include "DlgTest2.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CDlgTest2 dialogCDlgTest2::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_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CDlgTest2 message handlersvoid CDlgTest2::OnLABEL1_CLICK() {MessageBox("hello謝謝點擊");}void CDlgTest2::OnButton1() {// TODO: Add your control notification handler code hereMessageBox("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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.