![]() | |
| |||||||
| Home | Register | Blogs | FAQ | Members List | Calendar | Downloads | Arcade | Mark Forums Read |
| Languages, Compilers and Interpreters C,C++,C#,.NET,Java,PHP,Perl,SQL and more |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| Младенец Join Date: May 2004 Location: pakistan
Posts: 14
Rep Power: 0 Reputation:
10 | Hi: I want to draw a rectangle in a dialog when i click on a button. I write this code in the onbutton click function: CPaintDC dc(this); CRect r(20,20,100,100); dc.Rectangle(&r); This code does not showing any thing or any error. What is mistake. Burhan |
| | |
| | #2 | |
| The Reloaded Join Date: Jan 2002 Location: behind the flesh and gelatinе of soft dull eyes
Posts: 3,178
Rep Power: 7 Reputation:
45 | in CPaintDC's overview msdn says: Quote:
__________________ Сайт армянских маньяков | |
| | |
| | #3 |
| Administrator | it's bad practice to start acquaintance with graphics using buttons. For implementing owner-drawing buttons you have to create custom class (as well as override some methods, capture mouse, etc). It's easier to use CBitmapButton. Sample here: http://www.codeproject.com/buttonctrl/hoverbutton.asp or here: http://www.codeproject.com/buttonctrl/ Better explained sample here: http://www.codeproject.com/buttonctr...overbutton.asp hope this will by handy for you.
__________________ И повешенные могут качаться в неположенную сторону. /С.Е.Лец/ |
| | |
| | #4 |
| Грустно... | Или проще: GetDC()
__________________ http://аvitya.livejournal.com Хотели, как лучше, а получилось даже хуже... Лозунг шахматиста: На каждый шах - ответим матом! |
| | |
| | #5 | |
| Младенец Join Date: May 2004 Location: pakistan
Posts: 14
Rep Power: 0 Reputation:
10 | Quote:
I don't need any hoverbutton or owner draw button control. It is not metter what type of button i am using. Problem was that when i click on button a rectangle should draw on the client area of dialog. And my code is not running. Code is above. I hope u will understand. Thanks for ur oppinon. Burhan | |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Essay -The Simple Story | greka | Literary nook | 43 | Aug 26, 2002 18:19 |
| Just a simple Warcraft III artwork... | Jaguar | General | 2 | Aug 3, 2002 07:58 |
| ASCII code in c++ | Boyov | Languages, Compilers and Interpreters | 12 | Jul 18, 2002 04:42 |
| Top secret Microsoft code | Nosferatu | Fun | 0 | Apr 13, 2002 05:56 |
| Adding and removing devices in code??? | Jai | Languages, Compilers and Interpreters | 2 | Nov 1, 2001 15:32 |