W < >cancan not you seee i< >

扫一扫关注官方微信最近的《速度与激情7》相当的火,从第一部到第一部都吸引了大批的粉丝,在这个 钢筋混凝建筑的时代,许多年轻人都想像电影里的主人公一般,畅快的奔驰于茫茫苍野中享受速度带来的激情与痛快。速7的火爆也让其的主题曲&see you again&也成了一首热搜的歌曲。点击下方一起感受速度!以下是网友真情的纯真版的&see you again&,太好听了!
看过本文的人还看过
人气:44647 更新:
人气:37435 更新:
人气:35474 更新:
人气:25812 更新:
我们都爱笑的更多文章
大家在看 ^+^
推荐阅读 ^o^
家里出现这些征兆,预示你好运将至,一般人超不过3条!
苹果6s升完ios10再PK三星S7,满分!iPhone用户必升!
知青们,你们现在还好吗?
朗诵 | 变老的时候
猜你喜欢 ^_^
24小时热门文章
微信扫一扫
分享到朋友圈扫一扫关注官方微信look与see的区别_百度知道
look与see的区别
看见,看到,(盯着什么东西)看,表示看什么东西see强调的是结果,后面直接跟宾语look 强调的过程,看到一个人,后面要跟介词 at,see a person
来自团队:
look强调看的过程,比如look at sb.,look at sth. see强调看的结果,比如I can see two dogs. 望采纳,谢谢。
其他类似问题
为您推荐:
其他8条回答
t see anything:I looked but I didn&#39,不一定看到see指看到例look指看的动作
look 看 (动作) 如果有看的目标,用介词 at
Look at this picture!see 看见 (结果)及物动词 不需要介词直接带宾语
I see a picture.
区别:1、意思不同:look是指经常意义上的看,比较常用和口语化,就是我们一般随口就是look,还有名词表情的意思;see除了动词的看之外还当了解,明白的意思讲,而see大部分用做了解的意思,比如说I see,翻译成我了解了,我明白了,不能说说成我看见了。2、搭配:look做看的意思时一般接at,比如说Come on,look at this。意思是过来看看这个。而see后便直接跟名词,如I can see a battle on the table.我看见桌子上有个瓶子。
大体上这些,望采用。
look看,强调过程;see 看见,强调结果
LOOK侧重于看的过程,SEE侧重于看到的结果
look强调看的过程,see强调开的结果,see后不加介词
look是单纯的看
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁一般性问题
1.&&& 代码编译通过了,运行后RichEdit控件不显示,在InitInstance中添加
BOOL CWinApp::InitInstance ()
AfxInitRichEdit(); - RichEdit 1.0
或 AfxInitRichEdit2(); - RichEdit 2.0
2.&&& 升级默认的RichEdit版本,默认的版本有BUG,在InitInstance中添加
BOOL CWinApp::InitInstance ()
LoadLibrary("RICHED20.DLL");
FreeLibrary();
如果是CRichEditView基类的话,可用如下消息机制:
BOOL CRichEditView::PreCreateWindow(CREATESTRUCT& cs)
if (LoadLibraryA("RICHED20.DLL") == NULL)
AfxMessageBox(_T("Fail to load /"riched20.dll/"."),MB_OK |
MB_ICONERROR);
PostMessage(WM_QUIT,0,0);
return FALSE;
m_strClass = RICHEDIT_CLASSA;&
return CRichEditView::PreCreateWindow(cs);
3.&&& 在RichEdit控件的输入框中最后追加一行
CRichEditCtrl.SetSel(-1, -1);
CRichEditCtrl.ReplaceSel((LPCTSTR)str);
4.&&& 限制RichEdit控件的字数
CRichEditCtrl.LimitText(long nChars)
5.&&& 设置RichEdit控件的换行切换
如果是CRichEditView基类的话,可用如下消息机制:
BOOL CRichEditView::OnInitialUpdate()
m_nWordWrap = WrapN
WrapChanged();&
如果是在Dialog,可使用SetTargetDevice,并在RichEdit的属性里面加上want return
CRichEditCtrl.SetTargetDevice(m_dcTarget, GetPrintWidth());&
WrapChanged实际上也是调用
CRichEditCtrl.SetTargetDevice(NULL, 0); //m_nWordWrap == WrapToWindow
CRichEditCtrl.SetTargetDevice(NULL, 1); //m_nWordWrap == WrapNone
CRichEditCtrl.SetTargetDevice(NULL, 2);// m_nWordWrap == WrapToTargetDevice
6.&&& 设置RichEdit控件不带格式的数据粘贴
CRichEditCtrl.PasteSpecial(CF_TEXT);
7.&&& 设置RichEdit控件的滚动条自动随输入滚动到最后一行
int nFirstVisible = CRichEditCtrl.GetFirstVisibleLine();
if (nFirstVisible & 0)
CRichEditCtrl.LineScroll(-nFirstVisible, 0);
或CRichEditCtrl.PostMessage(WM_VSCROLL, SB_BOTTOM, 0);
8.设置RichEdit控件的撤销输入次数(只能用在RICHED20以上)
SendMessage(EM_SETTEXTMODE, TM_MULTILEVELUNDO, 0);
SendMessage(EM_SETUNDOLIMIT, 100, 0);
TM_MULTILEVELUNDO 支持多取消(默认值),可通过EM_SETUNDOLIMIT设置最大次数
9.设置RichEdit控件的OnChange事件
EM_SETEVENTMASK 设置 ENM_CHANGE&
long lMask = GetEventMask();
lMask |= ENM_CHANGE;
lMask &= ~ENM_PROTECTED;
SetEventMask(lMask);
10.设置RichEdit控件的只读属性
CRichEditCtrl::SetReadOnly(BOOL bReadOnly = TRUE );
通过设置PROTECTED实现选中的文本只读,参见如下文章:
/Cpp/controls/richedit/article.php/c2401/
1. 设置RichEdit控件的显示字体
CHARFORMAT
ZeroMemory(&cf, sizeof(CHARFORMAT));
cf.cbSize = sizeof(CHARFORMAT);
cf.dwMask|=CFM_BOLD;
cf.dwEffects|=CFE_BOLD; //粗体,取消用cf.dwEffects&=~CFE_BOLD;
cf.dwMask|=CFM_ITALIC;
cf.dwEffects|=CFE_ITALIC; //斜体,取消用cf.dwEffects&=~CFE_ITALIC;
cf.dwMask|=CFM_UNDERLINE;
cf.dwEffects|=CFE_UNDERLINE; //斜体,取消用cf.dwEffects&=~CFE_UNDERLINE;
cf.dwMask|=CFM_COLOR;
cf.crTextColor = RGB(255,0,0); //设置颜色
cf.dwMask|=CFM_SIZE;
cf.yHeight =200; //设置高度
cf.dwMask|=CFM_FACE;
strcpy(cf.szFaceName ,_T("隶书")); //设置字体
CRichEditCtrl.SetSelectionCharFormat(cf);
2.设置RichEdit控件的显示字体的行间距(只能用在RICHED20以上)
PARAFORMAT2
pf.cbSize = sizeof(PARAFORMAT2);
pf.dwMask = PFM_NUMBERING | PFM_OFFSET;
pf.wNumbering = PFN_BULLET; //注意PFM_NUMBERING&
pf.dxOffset = 10;
VERIFY(SetParaFormat(pf));&
常用的dwMask有如下列表:
PFM_NUMBERING 成员 wNumbering 才起作用
1 项目符号,默认用PFN_BULLET.
2 使用阿拉伯数字 (1, 2, 3, ...).
3 使用小写字母 (a, b, c, ...).
4 使用大写字母 (A, B, C, ...).
5 使用小写罗马数字 (i, ii, iii, ...).
6 使用大写罗马数字 (I, II, III, ...).
7 自定义,字符见成员 wNumberingStart.
PFM_OFFSET 成员 dxOffset 才起作用,缩进,单位twips
PFM_STARTINDENT 成员 dxStartIndent 才起作用,首行缩进
PFM_SPACEAFTER 成员 dySpaceAfter 才起作用,段间距
PFM_LINESPACING 成员 dyLineSpacing 才起作用,行间距
3.设置RichEdit控件的透明背景(只能用在RICHED20以上)
long style = ::GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE);
style &= WS_EX_TRANSPARENT;
::SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, style);
或 CreateEx(),然后把WS_EX_TRANSPARENT样式加上
4.获取或者写入RichEdit控件的内容
?&&&&&&&& GetWindowText
?&&&&&&&& 使用EM_GETTEXTEX
gt.cb = 200;
gt.flags = GT_DEFAULT;
gt.codepage = CP_ACP ;
gt.lpDefaultChar = NULL;
gt.lpUsedDefChar = NULL;
SendMessage(EM_GETTEXTEX,(WPARAM)&,(LPARAM)text);
?&&&&&&&& StreamOut(主要用于RTF等格式输出)
static DWORD CALLBACK;
MyStreamOutCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
CFile* pFile = (CFile*) dwC
pFile-&Write(pbBuff, cb);
CFile cFile(TEXT("myfile.rtf"), CFile::modeCreate|CFile::modeWrite);
EDITSTREAM
es.dwCookie = (DWORD) &cF //设置用例参数,以便回调函数调用
es.pfnCallback = MyStreamOutC
pmyRichEditCtrl-&StreamOut(SF_RTF, es);
读入可以此类推,SetWindowText, EM_SETTEXTEX, StreamIn
5.查找RichEdit控件中的字符串
FINDTEXTEX
ft.chrg.cpMin = 0;
ft.chrg.cpMax = -1;
ft.lpstrText = "|";
long lPos = FindText(0, &ft);
如果要继续查找,修改cpMin,如
int nCount = 0;
long lPos = GetRichEditCtrl().FindText(0, &ft);
if( -1 == lPos)
ft.chrg.cpMin = lPos + strlen(ft.lpstrText);
}while(TRUE);
6. 以Html格式保存RichEdit控件中的内容
临时做法可先转为RTF格式,再通过RTF-to-HTML Converter,参考如下文章:
/Cpp/controls/richedit/conversions/article.php/c5377/
8.&&& 重载OnProtected函数以得到RichEdit对应的消息,如粘贴等
void CRichEditorView::OnProtected(NMHDR* pNMHDR, LRESULT* pResult)
ENPROTECTED* pEP = (ENPROTECTED*)pNMHDR;
switch (pEP-&msg)
case WM_KEYDOWN: //按键,判断pEP-&wParam
case WM_PASTE: //粘贴
case WM_CUT: //剪切
case EM_SETCHARFORMAT:
*pResult = FALSE;
1. 设置RichEdit控件的链接功能(只能用在RICHED20以上)
LoadLibrary(_T("Riched20.dll"));
?&&&&&&&& 创建RichEdit2.0控件
CreateEx(0, _T("RichEdit20A"), NULL, WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP
|ES_READONLY|ES_WANTRETURN|ES_MULTILINE,
rect.left, rect.top, cx, cy, pParentWnd-&m_hWnd, (HMENU)nID, NULL);
?&&&&&&&& 设置选中的文字为链接显示
CHARFORMAT2 cf2;
ZeroMemory(&cf2, sizeof(CHARFORMAT2));//
cf2.cbSize = sizeof(CHARFORMAT2);
cf2.dwMask = CFM_LINK;
cf2.dwEffects |= CFE_LINK;
m_cRichEdit.SendMessage(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf2);
?&&&&&&&& 支持链接的点击响应
m_cRichEdit.SetEventMask(ENM_LINK);
?&&&&&&&& 响应链接的点击EN_LINK
BEGIN_MESSAGE_MAP(CMyRichEdit, CRichEditCtrl)
ON_NOTIFY_REFLECT(EN_LINK, OnURL)
END_MESSAGE_MAP()
void CMyRichEdit::OnURLClick(NMHDR *pNmhdr, LRESULT *pResult)
TCHAR LinkChar[512];
ENLINK *pLink = (ENLINK *)pN
if (pLink-&msg == WM_LBUTTONUP)
SetSel(penLink-&chrg); //这是链接的文字范围
long Res = GetSelText((char *)LinkChar); //这是链接文字
?&&&&&&&& 自动识别链接
UINT nMask = SendDlgItemMessage(IDC_RICHEDIT_MESSAGE, EM_GETEVENTMASK, 0, 0);
SendDlgItemMessage(IDC_RICHEDIT_MESSAGE, EM_SETEVENTMASK, 0, nMask | NM_LINK);
SendDlgItemMessage(IDC_RICHEDIT_MESSAGE, EM_AUTOURLDETECT, TRUE, 0);
BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
NMHDR* pNmHdr = (NMHDR *)lP
if(pNmHdr-&idFrom == IDC_RICHEDIT_MESSAGE && pNmHdr-&code ==
ENLINK *pLink = (ENLINK *)lP
if (pLink-&msg == WM_LBUTTONDOWN)
SendDlgItemMessage(IDC_RICHEDIT_MESSAGE, EM_EXSETSEL, 0,
(LPARAM)&(pLink-&chrg));
ShellExecute(GetSafeHwnd(), "open", m_wndREMessage.GetSelText(), 0,
0, SW_SHOWNORMAL);
return CDialog::OnNotify(wParam, lParam, pResult);
2.在RichEdit中插入位图
?&&&&&&&& 参考如下文章:
/Cpp/controls/richedit/article.php/c2417/
/Cpp/controls/richedit/article.php/c5383/
?&&&&&&&& 自定义在RichEdit中插入对象的图标
/user3/jiangsheng/blog/1319738.html
/richedit/richeditrc.html
3.在RichEdit显示GIF动画
?&&&&&&&& 常用的是通过QQ的imageole.dll(也有用Gif89.dll的)
http://www.xiaozhou.net/cooldog/blogview.asp?logID=82
/richedit/AnimatedEmoticon.asp
?&&&&&&&& 在richedit控件中插入动态GIF(Native C++版)
/jiangsheng/archive//41209.aspx
4.IRichEditOleCallback的使用
http://61.186.252.131/Expert/topic/905/905844.xml?temp=.8379022
5.类似MSN信息发送框的制作(上)
/document/viewdoc/?id=1087
内容包含:实现右键菜单,图片插入,读取/写入RTF格式字符串
6.自定义RichEdit控件
/document/viewdoc/?id=328
内容包含:鼠标右键消息,消息映射,字体变换
转载】MFC中的CEdit与CRichEdit使用技巧 15:41VC中在对话框上使用Rich Edit控件前一定要用AfxInitRichEdit()初
始化RichEdit环境.
--------------------------------------------------------------------------------
1.设置edit只读属性
&&& 方法一:
&&&&&&&&&&&&&&&
m_edit1.SetReadOnly(TRUE);
&&& 方法二:
&&&&&&&&&&&&&&&
::SendMessage(m_edit1.m_hWnd, EM_SETREADONLY, TRUE, 0);
--------------------------------------------------------------------------------
2.判断edit中光标状态并得到选中内容(richedit同样适用)
int nStart, nE
&&&&&&& CString strT
m_edit1.GetSel(nStart, nEnd);
&&&&&&& if(nStart == nEnd)
&&&&&&&&&&&
strTemp.Format(_T("光标在%d"), nStart);
&&&&&&&&&&&
AfxMessageBox(strTemp);
&&&&&&& else
&&&&&&&&&&& //得到edit选中的内容&&&&&
&&&&&&&&&&&
m_edit1.GetWindowText(strTemp);
&&&&&&&&&&& strTemp =
strTemp.Mid(nStart) - strTemp.Mid(nEnd);
&&&&&&&&&&&
AfxMessageBox(strTemp);&
&&& 注:GetSel后,如果nStart和nEnd,表明光标处于某个位置(直观来看就是光标在闪动);
&&&&&&&&&&&& 如果nStart和nEnd不相等,表明用户在edit中选中了一段内容。
--------------------------------------------------------------------------------
3.在edit最后添加字符串
&&&&&&& m_edit1.SetSel(-1, -1);
&&&&&&& m_edit1.ReplaceSel(str);
--------------------------------------------------------------------------------
4.随输入自动滚动到最后一行(richedit同样适用)
&&& 方法一:(摘自msdn)
&&&&&&& // The pointer to my edit.
&&&&&&& extern CEdit* pmyE
&&&&&&& int nFirstVisible =
pmyEdit-&GetFirstVisibleLine();
// Scroll the edit control so that the first visible line
&&&&&&& // is the first line of text.
&&&&&&& if (nFirstVisible & 0)
&&&&&&&&&&&
pmyEdit-&LineScroll(-nFirstVisible, 0);
&&& 方法二:
&&&&&&& m_richedit.PostMessage(WM_VSCROLL,
SB_BOTTOM, 0);
--------------------------------------------------------------------------------
5.如何限制edit输入指定字符
&& 可以从CEdit派生一个类,添加WM_CHAR消息映射。下面一个例子实现了限定输入16进制字符的功能。
CMyHexEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)&
&&&&&&& if ( (nChar &= '0' &&
nChar &= '9') ||&
&&&&&&&&&&&& (nChar
&= 'a' && nChar &= 'f') ||&
&&&&&&&& (nChar &= 'A' &&
nChar &= 'F') ||&
&&&&&&&&&&&&&
nChar == VK_BACK ||&
&&&&&&&&&&&&&
nChar == VK_DELETE)&&& //msdn的virtual key
&&&&&&&&&&&
CEdit::OnChar(nChar, nRepCnt, nFlags);&
&&&&&&& }&&&&
--------------------------------------------------------------------------------
6.如何使用richedit
&&& 添加AfxInitRichEdit();
&&&&&& CxxxApp::InitInstance()
&&&&&&&&&&&&
AfxInitRichEdit();
&&&&&&&&& .............
&& AfxInitRichEdit()功能:装载 RichEdit 1.0 Control (RICHED32.DLL).
--------------------------------------------------------------------------------
7.如何使用richedit2.0 or richedit3.0
&&& 使用原因:由于RichEdit2.0A自动为宽字符(WideChar),所以它可以解决中文乱码以及一些汉字问题
&&& 方法一:(msdn上的做法,适用于用VC.NET及以后版本创建的工程)
&&&&&&&&&&& To update
rich edit controls in existing Visual C++ applications to version 2.0,
&&&&&&&&&&& open the .RC
file as text, change the class name of each rich edit control from&&
"RICHEDIT" to
"RichEdit20a".&
&&&&&&&&&&& Then replace
the call to AfxInitRichEdit with AfxInitRichEdit2.
&&& 方法二:以对话框为例:
&&&&&& (1)&&& 增加一全局变量 HMODULE hM
&&&&&& (2)&&& 在CxxxApp::InitInstance()中添加一句hMod =
LoadLibrary(_T("riched20.dll"));
&&&&&&&&&&& 在CxxxApp::ExitInstance()中添加一句FreeLibrary(hMod);
&&&&&& (3)&&& 在对话框上放一个richedit,文本方式打开.rc文件修改该richedit控件的类名"RICHEDIT" to
"RichEdit20a".
&&&&&& (4)&&& 在对话框头文件添加 CRichEditCtrl m_
&&&&&&&&&&& 在OnInitDialog中添加
m_richedit.SubclassDlgItem(IDC_RICHEDIT1, this);
--------------------------------------------------------------------------------
8.改变richedit指定区域的颜色及字体
CHARFORMAT
&&&&&&& ZeroMemory(&cf,
sizeof(CHARFORMAT));
&&&&&&& cf.cbSize = sizeof(CHARFORMAT);
&&&&&&& cf.dwMask = CFM_BOLD | CFM_COLOR |
CFM_FACE |
&&&&&&&&&&&&&&&&&&&&&&&&&&&
CFM_ITALIC | CFM_SIZE | CFM_UNDERLINE;
&&&&&&& cf.dwEffects = 0;
&&&&&&& cf.yHeight = 12*12;//文字高度
&&&&&&& cf.crTextColor = RGB(200, 100, 255);
//文字颜色
&&&&&&& strcpy(cf.szFaceName ,_T("隶书"));//设置字体
&&&&&&& m_richedit1.SetSel(1, 5); //设置处理区域
&&&&&&& m_richedit1.SetSelectionCharFormat(cf);
--------------------------------------------------------------------------------
9.设置行间距(只适用于richedit2.0)
PARAFORMAT2
&&&&&&& pf2.cbSize = sizeof(PARAFORMAT2);
&&&&&&& pf2.dwMask = PFM_LINESPACING |
PFM_SPACEAFTER;
&&&&&&& pf2.dyLineSpacing = 200;
&&&&&&& pf2.bLineSpacingRule = 4;
&&&&&&& m_richedit.SetParaFormat(pf2);
--------------------------------------------------------------------------------
10.richedit插入位图
Q220844:How to insert a bitmap into an RTF document
using the RichEdit control in Visual C++ 6.0
/default.aspx?scid=en-220844
/Cpp/controls/richedit/article.php/c2417/
/Cpp/controls/richedit/article.php/c5383/
--------------------------------------------------------------------------------
11.richedit插入gif动画
/richedit/AnimatedEmoticon.asp
--------------------------------------------------------------------------------
12.richedit嵌入ole对象
/kb/141549/en-us
--------------------------------------------------------------------------------
13.使richedit选中内容只读
/cpp/controls/richedit/article.php/c2401/
--------------------------------------------------------------------------------
14.打印richedit
/MFC/RichEdit3.htm
--------------------------------------------------------------------------------
15.richeidt用于聊天消息窗口
/document/viewdoc/?id=1087
/richedit/chatrichedit.asp
/Cpp/controls/richedit/article.php/c2395/
--------------------------------------------------------------------------------
16.解决richedit的EN_SETFOCUS和EN_KILLFOCUS无响应的问题
/kb/181664/en-us
--------------------------------------------------------------------------------
17.richedit拼写检查
/com/AutoSpellCheck.asp
--------------------------------------------------------------------------------
18.改变edit背景色
Q117778:How to change the background color of an
MFC edit control
/kb/117778/en-us
--------------------------------------------------------------------------------
19.当edit控件的父窗口属性是带标题栏WS_CAPTION和子窗口WS_CHILD时,不能设置焦点SetFocus
Q230587:PRB: Can't Set Focus to an Edit Control
When its Parent Is an Inactive Captioned Child Window
/kb/230587/en-us
--------------------------------------------------------------------------------
20. 在Edit中回车时,会退出对话框
选中Edit的风格Want Return。
MSDN的解释如下:
ES_WANTRETURN&&& Specifies that a carriage return be inserted
when the user presses the ENTER key while entering
text into a multiple-line edit control
in a dialog box. Without this style, pressing the ENTER key has the same
effect as pressing the dialog box's
default pushbutton. This style has no effect on a single-line edit control.
--------------------------------------------------------------------------------
21. 动态创建的edit没有边框的问题
&&& m_edit.Create(....);
&&& m_edit.ModifyStyleEx(0, WS_EX_CLIENTEDGE, SWP_DRAWFRAME);
--------------------------------------------------------------------------------
22. 一个能显示RTF,ole(包括gif, wmv,excel ,ppt)的例子
/richedit/COleRichEditCtrl.asp
http://blog.csdn.net/lixiaosan/archive//652795.aspx
Environment: VC6 SP4, 2000.
Follow these 10 easy steps to build the
OutLookRichEdit control:
Insert a rich edit control into the
Call AfxInitRichEdit() in the InitInstance of the App class or in InitDialog.&
If it does not exist, copy OutLookRichEdit.cpp and OutLookRichEdit.h to the
project directory.&
Click the menu choice Project-Add to Project-Files and select the above-copied
files to add the wrapper class to
your project.&
Import the hand cursor into the resource and rename it "IDC_LINK".&
Use Classwizard to add a member variable of the rich edit control
(CRichEditCtrl).&
Include the OutLookRichEdit.h file in the dialog's header file and change the
declaration of rich edit member
variable, as in&
CRichEditCtrl&&& m_ctrlText1;
COutLookRichEdit m_ctrlText1;
In InitDialog(), add the following code.&
m_ctrlText1.SetRawHyperText(_T("Click &%$here$#100#%&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
to see the about box."));
At this level, if you build the project and run it, you can see the rich edit
control with linked text, but
nothing would happen if you clicked on
To Show a dialog while the link is
clicked, you have to add some more code in the dialog class. Before that, have
a closer look at the preceding code and
hypertext syntax. The link text is enclosed between the "$" symbols
the corresponding dialog's resource
value 100 (About Box), enclosed in "#" symbols.
You can find the #define values of
dialogs in the resource.h file.
Use ClassWizard to map OnNotify of the
dialog and write the corresponding implementation code in .cpp file, like:&
BOOL CDEMODlg::OnNotify(WPARAM wParam,
&&&&&&&&&&&&&&&&&&&&&&&
LPARAM lParam,
&&&&&&&&&&&&&&&&&&&&&&&
LRESULT* pResult)
& NMHDR* pNmHdr = (NMHDR*) lP
& if(IDC_RICHEDIT1 == pNmHdr-&idFrom){
&&& switch(pNmHdr-&code)
&&&&& case IDD_ABOUTBOX:
&&&&&&& CAboutDlg oD
&&&&&&& oDlg.DoModal ();
& return CDialog::OnNotify(wParam, lParam, pResult);
Now, build and run the project. It is recommended that you set the read-only
attribute to the rich edit control.&
Download demo project - 23 Kb
Download source - 6 Kb
在RichEdit中插入Bitmap
sm.tymed=TYMED_GDI;
sm.hBitmap=
sm.pUnkForRelease=NULL;
src.CacheData(CF_BITMAP, &sm);
LPDATAOBJECT lpDataObject =
(LPDATAOBJECT)src.GetInterface(&IID_IDataObject);
pRichEditOle-&ImportDataObject(lpDataObject, 0, NULL);
lpDataObject-&Release();
字体设置代码
最后添加字体变换函数:&
CHARFORMAT&
memset(&cf, 0, sizeof(CHARFORMAT));&
memset(&lf, 0, sizeof(LOGFONT));
//判断是否选择了内容&
BOOL bSelect = (GetSelectionType() != SEL_EMPTY) ? TRUE : FALSE;&
if (bSelect)&
&&&&&&&&&&&&
GetSelectionCharFormat(cf);&
&&&&&&&&&&&&
GetDefaultCharFormat(cf);&
//得到相关字体属性&
BOOL bIsBold = cf.dwEffects & CFE_BOLD;&
BOOL bIsItalic = cf.dwEffects & CFE_ITALIC;&
BOOL bIsUnderline = cf.dwEffects & CFE_UNDERLINE;&
BOOL bIsStrickout = cf.dwEffects & CFE_STRIKEOUT;
//设置属性&
lf.lfCharSet = cf.bCharS&
lf.lfHeight = cf.yHeight/15;&
lf.lfPitchAndFamily = cf.bPitchAndF&
lf.lfItalic = bIsI&
lf.lfWeight = (bIsBold ? FW_BOLD : FW_NORMAL);&
lf.lfUnderline = bIsU&
lf.lfStrikeOut = bIsS&
sprintf(lf.lfFaceName, cf.szFaceName);&
&&&&&&&&&&&&
CFontDialog dlg(&lf);&
dlg.m_cf.rgbColors = cf.crTextC&
if (dlg.DoModal() == IDOK)&
&&&&&&&&&&&&
dlg.GetCharFormat(cf);//获得所选字体的属性&
&&&&&&&&&&&& if
(bSelect)&
&&&&&&&&&&&&&&&&&&&&&&&&
SetSelectionCharFormat(cf);&&&& //为选定的内容设定所选字体&
&&&&&&&&&&&& else&
&&&&&&&&&&&&&&&&&&&&&&&&
SetWordCharFormat(cf);&&&&&&&& //为将要输入的内容设定字体&
在RichEdit中实现超链接
在RichEdit中实现超链接&
责任编辑:admin   在CBuilder上制作 更新日期:&
首先在Form上放置一个RichEdit。
在窗体的构造函数中添加以下代码:
__fastcall TMainForm::TMainForm(TComponent* Owner)
&&&&&&&& : TForm(Owner)
&&&& unsigned mask = SendMessage(RichEdit1-&Handle,
EM_GETEVENTMASK, 0, 0);
&&&& SendMessage(RichEdit1-&Handle, EM_SETEVENTMASK, 0,
mask | ENM_LINK);
&&&& SendMessage(RichEdit1-&Handle, EM_AUTOURLDETECT,
true, 0);&& //自动检测URL
RichEdit1-&Text = "欢迎访问C++ Builder/n"
&&&&&&&&&&&&&&&&&&&&&&
"网址:&/n"
&&&&&&&&&&&&&&&&&&&&&&
"偶的信箱:/n"
&&&&&&&&&&&&&&&&&&&&&&
"mailto::&/n"
&&&&&&&&&&&&&&&&&&&&&&
重载窗体的WndProc
1。在.h中添加:
&&& protected:
&&&&&& virtual void __fastcall
WndProc(Messages::TMessage &Message);
2。在.cpp中添加:
//---------------------------------------------------------------------------
void __fastcall TMainForm::WndProc(Messages::TMessage &Message)
&&&& if (Message.Msg == WM_NOTIFY)
&&&&&&&& if
(((LPNMHDR)Message.LParam)-&code == EN_LINK)
&&&&&&&& {
&&&&&&&&&&&&
ENLINK* p = (ENLINK *)Message.LP
&&&&&&&&&&&& if
(p-&msg == WM_LBUTTONDOWN)
&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&
SendMessage(RichEdit1-&Handle, EM_EXSETSEL, 0, (LPARAM)&(p-&chrg));
&&&&&&&&&&&&&&&&
ShellExecute(Handle, "open", RichEdit1-&SelText.c_str(), 0, 0,
SW_SHOWNORMAL);
&&&&&&&&&&&& }
&&&&&&&& }
&&&& TForm::WndProc(Message);

我要回帖

更多关于 if you can see 的文章

 

随机推荐