943,509 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 5658
  • C++ RSS
Mar 20th, 2003
0

Visual C++

Expand Post »
Using Dialog Box:

I want to draw a ball in a solid color and be able to move the ball around on the Dialog Box.

Thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lyar1977 is offline Offline
1 posts
since Mar 2003
Mar 22nd, 2003
0
Re: Visual C++
There's different ways to do this. How do you want to do it? You can do it quickly with dialog wizards or code it from scratch. This sounds like a class assignment. You have to be more specific.
Team Colleague
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
samaru is offline Offline
1,227 posts
since Feb 2002
May 14th, 2003
0

Re: Visual C++

Quote originally posted by lyar1977 ...
Using Dialog Box:
I want to draw a ball in a solid color and be able to move the ball around on the Dialog Box.
Simplest way I can think of would be to set up a timer and update the coordinates of the ball in it. Call InvalidateRect and UpdateWindow to force an update of the screen.

Override the OnPaint message handler for your dialog. Draw your ball in there using the device context pointer provided.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
evenstar is offline Offline
2 posts
since May 2003
May 18th, 2003
0
Re: Visual C++
I think what it seems to me that he wants is to associate the moving object (the ball) with a keyboard or mouse control.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
May 19th, 2003
0
Re: Visual C++
I've coded a simple program that lets the user control the position of a ball via the arrow keys.

http://www.abdn.ac.uk/~u02cll2/windo...movingball.jpg

The program can be downloaded here.

The source code can be viewed in HTML format here.
Reputation Points: 13
Solved Threads: 0
Light Poster
Dante Shamest is offline Offline
46 posts
since Apr 2003
May 20th, 2003
0
Re: Visual C++
You got too much time on your hands.
Team Colleague
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
samaru is offline Offline
1,227 posts
since Feb 2002
May 20th, 2003
0
Re: Visual C++
Nah, it was good practice.
Reputation Points: 13
Solved Threads: 0
Light Poster
Dante Shamest is offline Offline
46 posts
since Apr 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: What Language is used in software like Adobe Photoshop?
Next Thread in C++ Forum Timeline: Help me please





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC