Jan 25, 2004 #1 nexius Programmer Jul 8, 2000 109 CA Hi I'm trying to figure out how to use CPen, CBrush, etc in a dialog box control like say, a picture or a static text object. Is this even possible? I can draw it on the dialog box itself but I'd like to restrict it to a certain part of it. Any help appreciated
Hi I'm trying to figure out how to use CPen, CBrush, etc in a dialog box control like say, a picture or a static text object. Is this even possible? I can draw it on the dialog box itself but I'd like to restrict it to a certain part of it. Any help appreciated
Jan 26, 2004 #2 woja Programmer Jan 5, 2004 438 GB You'd need to subclass the control you're using to draw in and override its [tt]Paint[/tt] method. [tt]________________________________________________________________ Roger Life is a game of cards in which the deck contains only jokers.[/tt] Upvote 0 Downvote
You'd need to subclass the control you're using to draw in and override its [tt]Paint[/tt] method. [tt]________________________________________________________________ Roger Life is a game of cards in which the deck contains only jokers.[/tt]
Jan 26, 2004 Thread starter #3 nexius Programmer Jul 8, 2000 109 CA Alright I figured it out... I used something along these lines for anyone that maybe searched and found this thread: CPaintDC dc(this); CRect rect(5,10,150,170); CBrush brush(COLORREF(0x0000BBBB)); CWnd *lpStaticWnd; CRect static_rect; lpStaticWnd = GetDlgItem(IDC_STATIC1); lpStaticWnd -> GetWindowRect(&static_rect); ScreenToClient(&static_rect); dc.IntersectClipRect(&static_rect); dc.FillRect(&rect,&brush); Upvote 0 Downvote
Alright I figured it out... I used something along these lines for anyone that maybe searched and found this thread: CPaintDC dc(this); CRect rect(5,10,150,170); CBrush brush(COLORREF(0x0000BBBB)); CWnd *lpStaticWnd; CRect static_rect; lpStaticWnd = GetDlgItem(IDC_STATIC1); lpStaticWnd -> GetWindowRect(&static_rect); ScreenToClient(&static_rect); dc.IntersectClipRect(&static_rect); dc.FillRect(&rect,&brush);