473,387 Members | 3,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Windows form - moving controls

fayazmd
41
Hi,
I am creating an exe for which i need three conditions.
1. The windows form should randomly move over the screen w.r.t. time
2. A label on the form should move randomly w.r.t. time
3. A button should be moved w.r.t. Mouse, On mouse over the button should be placed some where in the form.

I am working in C# Windows App in .net 2003.
Jan 24 '08 #1
6 1413
Plater
7,872 Expert 4TB
All of the objects you mentioned have coordinates that can be accessed and changed.
Simple change them to what you want and they will move (you may have to call a .Update() on the control, or it's parent if you want to see better response time)
Jan 24 '08 #2
fayazmd
41
Hi Plater,
I am extremely sorry that i am new to this.
Could you show me some sample codes for these conditions.

All of the objects you mentioned have coordinates that can be accessed and changed.
Simple change them to what you want and they will move (you may have to call a .Update() on the control, or it's parent if you want to see better response time)
Jan 25 '08 #3
Shashi Sadasivan
1,435 Expert 1GB
The Location Property of the controls is what you are looking for !!!
Jan 25 '08 #4
fayazmd
41
How can i change location property during run time with timer?

The Location Property of the controls is what you are looking for !!!
Jan 25 '08 #5
debasisdas
8,127 Expert 4TB
How can i change location property during run time with timer?
You need to assign random values to X and Y of location in the timer event.

The random numbers should be in a particular range.
Jan 25 '08 #6
fayazmd
41
Thanks!

I got it.

You need to assign random values to X and Y of location in the timer event.

The random numbers should be in a particular range.
Jan 29 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: James CC | last post by:
I have a strange bug in C# using windows forms. To make sure it's not some bug with my code, I've gone back to a simple test app, and still see the same behavior. I have created a simple C#...
14
by: RL Stevenson | last post by:
What is a reasonable way to manage a complex form with 5 or so tabs with 100 or more controls bound to 5-10 tables in a database? Pasting all those controls, datasets, data adapters directly onto...
14
by: Jan Nielsen | last post by:
Hi In Microsoft Access it is possible to write code like this Sub test() DoCmd.OpenForm "TestForm", acDesign Dim a As Control For Each a In Forms("TestForm").Controls Do stuff Next End Sub
2
by: MadMikey | last post by:
Can I change the order that controls are defined, or built, in the "Windows Form Designer generated code" section? I'm using VB.NET 2003. I have a custom control, that due to licensing...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
4
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
3
by: mattgcon | last post by:
I was curiuos if anyone knew of a way to allow drag and drop functionality on the actual controls themselves during runtime within a Windows Application. I want to allow the user to customize a...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
9
by: Scott Stark | last post by:
Hello, I'm *just* delving into Windows forms-based programming without the benefit of any books, etc. I have a background in light ASP.NET work, so forgive me if this is a really basic question...
1
by: Kevinst | last post by:
Hello there, I have got a problem and several approaches but none is really staisfying: Lets assume we have a form. On its surface we have got several animations (like a blinking light). This...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.