C++ Caption
|
主题 |
|
1. 2. |
|
Caption属性 |
|
取得一个窗体的标题(caption)文字,或者一个控件的内容
|


|
SetWindowText |
|
BOOL SetWindowText( HWND hWnd, LPCTSTR lpString ); |
|
SetDlgItemText |
|
void SetDlgItemText(
int
nID, //控件的ID号 LPCTSTR lpszString
//字符串 );
|
|
设置控件的标题文本 使用API SetWindowText |
|
//使用CWnd
CWnd *pWnd;
pWnd = GetDlgItem( IDC_BUTTON1 ); //按钮1的ID
pWnd->SetWindowText( "ABC" );
//设置主窗体的标题
SetWindowText(_T("MFC"));
//设置按钮的文本
GetDlgItem(IDC_BUTTON1)->SetWindowText(_T("BTN1"));
//或
SetDlgItemText(IDC_BUTTON1,"ABCD");
//设置多选框的文字 (关联变量)
m_CHK1.SetWindowText(_T("CheckBox1"));
//或
SetDlgItemText(IDC_CHECK1,"ABCD");
|
|
GetWindowText |
|
int
GetWindowText( HWND hWnd,
LPTSTR lpString,
int nMaxCount
);
|
|
GetDlgItemText |
|
int GetDlgItemText(
int nID,
LPTSTR lpStr,
int nMaxCount
) const;
int GetDlgItemText(
int nID,
CString& rString
) const;
|
|
获取控件的标题文本 |
|
//获取到按钮1的文本
并设置给主窗体的标题 CString
str; this->GetDlgItem(IDC_BUTTON1)->GetWindowText(str);
this->SetWindowText(str);
CString s;
GetDlgItemText(IDC_BUTTON1,s);
MessageBox(s); |
C++ Caption的更多相关文章
- duilib的caption上的Edit无法激活
当窗口设置标题栏时,鼠标等控件可以相应,edit无法响应. 主要和WindowImplBase::OnNcHitTest 虚函数有关. LRESULT WindowImplBase::OnNcHitT ...
- HTML 表格<table><caption><th><tr><td><thead><tbody><tfoot><col><colgroup>
<table>标签: 定义和用法: <table>标签定义HTML表格. 简单的HTML表格由table元素以及一个或多个tr.th或td元素组成. tr元素定义表格行,th元 ...
- html中 table的结构 彻底搞清 caption th thead等
正因为有太多 随意 称呼的 教法, 所以 感到很困惑, 如, 很多人把th叫标题. 那人家 caption怎么想, th只是一个跟td一样的角色, 只是对他进行加粗 加黑了而已, 用于某些单元格的内容 ...
- caption,为表格增加标题和摘要
格式: <table summary="***"> <caption>***</caption> <tr> </tr> ...
- latex figure \label 放在\caption 后
http://www.cnblogs.com/loca/p/4264686.html latex figure \label 放在\caption 后,否则将显示\section 或者\subsect ...
- 一行代码设置TLabel.Caption的前世今生
第零步,测试代码: procedure TForm1.Button1Click(Sender: TObject); begin Label1.Caption := 'Hello World'; end ...
- Need to add a caption to a jpg, python can't find the image
importImage,ImageDraw,ImageFont, os, glob list = glob.glob('*.jpg')for infile in list:print infile f ...
- VCL源码分析方法论(以TButton.Caption属性的由来为例)
最近一段时间似乎流行源码分析:)我也来谈谈在过去一段时间里对VCL源码的分析方法方面的一点体会,本文将不探讨VCL类库的构架和设计模式方面的东本,只是以我们常见的控件属性/方法的实现过程作简单的说明, ...
- delphi Caption 垂直显示标签文本
//垂直显示标签文本 Label1.Caption:='垂'+#13+'直'+#13+'显'+#13+'示';//使用相同的方法,我们也可以制作垂直显示的提示(Hint):button1.Hint:= ...
随机推荐
- webservice-WebService试题
ylbtech-doc:webservice-WebService试题 WebService试题 1.A,返回顶部 001.{WebService题目}下列是Web服务体系结构中的角色的是()(选择3 ...
- [BILL WEI] A potentially dangerous Request.Path value was detected from the client 异常处理办法
我们在ASP.net中使用URL导向后, 我们在访问某个地址,或者打开某个系统页面的时候,就会报错误: A potentially dangerous Request.Path value was d ...
- Android的AutoCompleteTextView在API17高版本添加的setText函数在低版本系统居然能正常调用?官方文档是不是不靠谱了?
官方文档:https://developer.android.com/reference/android/widget/AutoCompleteTextView.html#setText(java.l ...
- 一个FragmentActivity多个Fragment的生命周期事件记录
初次打开FragmentActivity时 VisitTaskManagerActivity(): onCreate VisitTaskManagerActivity(): onStart Visit ...
- 多校1005 HDU5785 Interesting (manacher)
// 多校1005 HDU5785 Interesting // 题意:给你一个串,求相邻两个回文串左边端点*右边端点的和 // 思路:马拉车算出最长回文半径,求一个前缀和,既得到每个点对答案的贡献. ...
- 多校5 1001 HDU5781 ATM Mechine 记忆化搜索+概率
// 多校5 1001 HDU5781 ATM Mechine // http://acm.hdu.edu.cn/search.php?field=problem&key=2016+Multi ...
- leetcode—Swap Nodes in Pairs
1.题目描述 Given a linked list, swap every two adjacent nodes and return its head. For example, Given ...
- FindBugs Bug Descriptions
FindBugs Bug Descriptions ◇例1: Integer a = ; String str ="; System.out.println(str == a.toStrin ...
- 一个考察for循环题 讨论一下
一道Java程序题,主要是考察for循环如下所示: public class Test { static boolean fun(char c) { System.out.print(c); retu ...
- 防asp木马运行
首 页 > 技术支持 防asp木马运行 目前比较流行的ASP木马主要通过三种技术来进行对服务器的相关操作. 一.使用FileSystemObject组件 FileSystemObject可以对文 ...