Visual C++

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2003
Posts: 1
Reputation: lyar1977 is an unknown quantity at this point 
Solved Threads: 0
lyar1977 lyar1977 is offline Offline
Newbie Poster

Visual C++

 
0
  #1
Mar 20th, 2003
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 1,135
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Solved Threads: 6
Team Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor
 
0
  #2
Mar 22nd, 2003
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.
Check out my blog at http://www.shinylight.com for more stuff about web dev.
Reply With Quote Quick reply to this message  
Join Date: May 2003
Posts: 2
Reputation: evenstar is an unknown quantity at this point 
Solved Threads: 0
evenstar evenstar is offline Offline
Newbie Poster

Re: Visual C++

 
0
  #3
May 14th, 2003
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,040
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 127
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb
 
0
  #4
May 18th, 2003
I think what it seems to me that he wants is to associate the moving object (the ball) with a keyboard or mouse control.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Apr 2003
Posts: 46
Reputation: Dante Shamest is an unknown quantity at this point 
Solved Threads: 0
Dante Shamest's Avatar
Dante Shamest Dante Shamest is offline Offline
Light Poster
 
0
  #5
May 19th, 2003
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 1,135
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Solved Threads: 6
Team Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor
 
0
  #6
May 20th, 2003
You got too much time on your hands.
Check out my blog at http://www.shinylight.com for more stuff about web dev.
Reply With Quote Quick reply to this message  
Join Date: Apr 2003
Posts: 46
Reputation: Dante Shamest is an unknown quantity at this point 
Solved Threads: 0
Dante Shamest's Avatar
Dante Shamest Dante Shamest is offline Offline
Light Poster
 
0
  #7
May 20th, 2003
Nah, it was good practice.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC