473,671 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating and Drawing Shapes on a Form

I am just beginning to get into designing (hand-coding) forms with .Net using C++. I am trying to write a very simple application that has buttons on it and draws a black ball every 10 milliseconds that bounces around the screen which I plan to use to learn more about programming in .Net and as a reference for future programs. I placed every function and variable in a single class (except the main() function) that extends the Form class. I placed a call to Invalidate(), Update(), and Sleep(10) (in that order) in an idle function which I then used as the function to handle the Application Class's Idle event. The program does draw the black ball properly and does call the idle function but it only calls it after another event occures (such as when the mouse is moved over the form). I was wondering whether anyone could either tell me a way to fix this problem so that the black ball is drawn and moved every 10 milliseconds or provide me with a better way to do this. Any help on this would be greatly appriciated.
Jul 21 '05 #1
0 1352

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11781
by: BG | last post by:
We're having trouble writing the code to update a UI control (label.Text) from a secondary thread. We're using C# with Windows Forms. We have a main form named MainForm, a splash screen form named SplashScreen, and a C# class library named BackgroundProcess.
3
3063
by: steve bull | last post by:
I have a program in which I draw various shapes to a form but I would like to move it off the form into a user control. The painting on the form takes a significant amount of time. I was thinking of making a bitmap map to the control so that when it does a refresh it doesn't need to recalculate everything. It is easy using the form because I have clipping and all the graphics draw routines(line, polygon etc). Is there a way to draw to a...
1
2516
by: Andreas Schubert | last post by:
Hello newsgroup, I am pretty new to .NET and need some advise on how to approach to the following: I have to create an application with a drawing surface, where some predefined shapes (picture boxes with icons in it) can be dropped and moved around. This should work like some MS Visio on a very basic level. The shapes should be dragged from a list.
2
2615
by: Dursun | last post by:
Collegues, is it possible to do the foloowing: Let end user draw specific shapes (a circle that has a number within it and a connector that points to a specific area on the background image) using Windows Forms and controls. To be more specific, I want to design a VB.Net Windows form where end user will mark damages on an airplane picture (which might be background picture of the form) using a marker object that has a circle (with a...
0
298
by: Jack | last post by:
I am just beginning to get into designing (hand-coding) forms with .Net using C++. I am trying to write a very simple application that has buttons on it and draws a black ball every 10 milliseconds that bounces around the screen which I plan to use to learn more about programming in .Net and as a reference for future programs. I placed every function and variable in a single class (except the main() function) that extends the Form class. I...
9
3172
by: davetelling | last post by:
I am not a programmer, I'm an engineer trying to make an interface to a product I'm designing. I have used C# to make a form that interrogates the unit via the serial port and receives the data. I want to be able to draw lines in a picturebox based upon certain data points I have received. I dragged a picturebox from the toolbar onto my form, but after having gone through the help files, looking online and trying a variety of things, I...
10
2178
by: Tina | last post by:
I need to find drawing software for my websites. I'm guessing that Adobe Photoshop is an overkill. What's best for creating bitmaps usable for websites? Thanks, T
6
1912
by: dr3amxstar | last post by:
Hi Im using VB express 2005 I encountered some problems while drawing shapes in visual basic. Whenever i print shape on the picturebox it appears, but when i minimize it or go to another form and then come back to the form where the picturebox is, the image will disappear and i have to click the button for the image to be visible again. Is there any way to make the image stay? Private Sub Button2_Click(ByVal sender As System.Object,...
4
12313
debasisdas
by: debasisdas | last post by:
This article contains the basic syntax to draw graphics of various shapes and sizes in Visual Basic 6.0. Different types of geometrical shapes (rectangle, square, circle, arc, ellipse etc.) can be drawn on the form by using the following syntax. Basic syntax (for line, rectangle, square) ============================= OBJECT.LINE (X1, Y1) -(X2, Y2), , ] STEP -- KEYWORD SPECIFYING THAT THE STARTING POINT COORDINATES ARE RELATIVE TO THE...
0
8393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8598
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8670
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7433
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6223
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5695
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2810
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.