Environment: VC6.0 SP5, Windows 2000, STL
For my project, I need a static control with hyperlink and scroll functions. I found the "CHotStatic - hyperlink CStatic" article. However, the static control can only have one hyperlink, and it does not have the scroll function. So, I expanded it. This class (CScrollHotStatic) is derived from CStatic with multi-hyperlink and scroll functions.
You can use it easily. Just follow these steps:
- Create a new static control in your resource and add a DDX_Control for it.
- Change CStatic to CScrollHotStatic in the header file.
- Use the AddText function to add displayed texts. For example:
m_ctrlHotStatic.AddText ("------CScrollHotStaticTestDlg 1.0.0.1------"); m_ctrlHotStatic.AddText("\tProgram Web Site:"); m_ctrlHotStatic.AddText("CodeGuru", "www.codeguru.com", 12); m_ctrlHotStatic.AddText("MSDN Web Site", "msdn.microsoft.com", 12); m_ctrlHotStatic.AddText("......."); m_ctrlHotStatic.AddText("Mail Web Site:"); m_ctrlHotStatic.AddText("mail.yahoo.com", "mail.yahoo.com", 12); m_ctrlHotStatic.AddText("www.hotmail.com", "www.hotmail.com", 12);
The definition is:
void AddText(LPCTSTR lpStrText, LPCTSTR lpStrLink=NULL, DWORD dwStartXPos=0); // lpStrText: The string is displayed in control // lpStrLink: The link string for this item // dwStartXPos: The horizontal position for this item
Downloads
Download demo project - 16 KbDownload source code - 5 Kb
'Windows > MFC' 카테고리의 다른 글
GDI+ Setting (설정, 셋팅) (0) | 2013.10.02 |
---|---|
비트맵 (bitmap) (0) | 2013.10.02 |
메뉴 (Menu object) (0) | 2013.10.02 |
폰트 (Font Object) (0) | 2013.10.02 |
다이얼 로그 박스 (Dialogbox) (0) | 2013.10.02 |