|
-
May 24th, 2002, 05:06 AM
#1
HyperLink in Dialog Box
Hi,
I want to provide a hyperlink on a dialog box in my application. Is there any ActiveX control for that ? Or How else could I provide a functionality similiar to a Hyperlink on a dialog Box. Please suggest a solution.
Regards,
Nitin
Nitin S. Jadhav
-
May 24th, 2002, 05:08 AM
#2
There are sevrel HyperLink controls here at CodeGuru, look in the controls page and you will find all that you need.
-
May 24th, 2002, 05:09 AM
#3
I use an owner-drawn button and the following code:
Code:
void CAboutDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
if (nIDCtl==IDC_LINK)
{
CString strURL;
GetDlgItem(IDC_LINK)->GetWindowText(strURL);
COLORREF cr = lpDrawItemStruct->itemState & ODS_SELECTED
? RGB(255,0,0) : RGB(0,0,255);
CRect rcItem = lpDrawItemStruct->rcItem;
rcItem.top += 2;
CDC dc;
dc.Attach(lpDrawItemStruct->hDC);
CPen pen(PS_SOLID, 1, cr);
CPen* pOld = dc.SelectObject(&pen);
dc.SetTextColor(cr);
dc.DrawText(strURL, &rcItem, DT_CALCRECT | DT_SINGLELINE);
dc.DrawText(strURL, &rcItem, DT_SINGLELINE);
dc.MoveTo(rcItem.left, rcItem.bottom);
dc.LineTo(rcItem.right, rcItem.bottom);
dc.SelectObject(pOld);
dc.Detach();
}
}
BOOL CAboutDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if (pWnd->GetDlgCtrlID()==IDC_LINK)
{
if (HCURSOR hCurs = LoadCursor(NULL, MAKEINTRESOURCE(32649)))
{
SetCursor(hCurs);
return TRUE;
}
}
return CDialog::OnSetCursor(pWnd, nHitTest, message);
}
regards,
MiMec
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|