473,794 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Moving graphics using the mouse

Hi Everyone:
I'm trying to make a simple windows application that allows me to draw a
shape on the form using a Graphics object. Drawing the shape is pretty
simple. My problem is I don't know how to capture the region of the shape and
place that into a container that I can move while holding the mouse button
down.

I have seen this done in many other Windows applications.

Can anyone point me in the direction I need to go? Sample code would be
wonderful.

Thanks,
--
Mark
Nov 20 '07 #1
1 1622
Please use Control.MouseMo ve Event.

http://www.alvas.net - Audio tools for C# and VB.Net developers
"Mark" <Ma**@discussio ns.microsoft.co mÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: news:AB******** *************** ***********@mic rosoft.com...
Hi Everyone:
I'm trying to make a simple windows application that allows me to draw a
shape on the form using a Graphics object. Drawing the shape is pretty
simple. My problem is I don't know how to capture the region of the shape
and
place that into a container that I can move while holding the mouse button
down.

I have seen this done in many other Windows applications.

Can anyone point me in the direction I need to go? Sample code would be
wonderful.

Thanks,
--
Mark

Nov 22 '07 #2

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

Similar topics

2
1518
by: willem | last post by:
Hi, I want move my form with mouse when I press button over a different position from normal bar of title. I set MouseUp, MouseDown and, MouseMove events and all works good. is it possible work with a more intelligent method ? When I move a normal form only its border is visible.
6
8168
by: johannblake | last post by:
I am wondering whether it is easy to setup a coordinate system for drawing (using GDI+) that uses meters (or any custom scaling for that matter). Currently, I need to convert from pixels to meters for scaling. This can sometimes get rather complex when you need to take scaling into account or other things like window resizing, scrolling, etc. There is a property called PageUnit which can be set to World. I could not find any examples...
0
878
by: SStory | last post by:
I have a pnlControl in which I am using as a workspace on which to drag several pictures and drop them. These are bitmaps that are no more than 150x150 at the largest. I keep up with them and their related info in a class. At present no controls are used for this. What I need to be able to do and am not sure how: 1.) allow the user to smoothly drag the bitmap around inside this pnlControl using the mouse.
0
1254
by: Gino | last post by:
Hi, I wish to code a control that writes a text over a picturebox and that can be dragged with mouse. Here is what i've actually coded to obtain a similar effect, but as you can see i've serious problems with trasparence Create new project and add a button in the form and then insert a background image to the form itself.
2
3115
by: Carl Gilbert | last post by:
Hi I have a math kinda problem where I'm trying to split some lines when two or more lines connect two shapes. The reason I am doing this is to make it clear that there are multiple lines connecting the two shapes. http://www.blackwaterbadgers.co.uk/image1.bmp Image 1 shows how if you have a line between two shapes, the line is straight. if you have more than one line, the lines will start overlapping
0
2172
by: MrNobody | last post by:
I have a custom Panel which will have smaller custom Panels added and drawn within it. I want to be able to re-order the arrangement of the inner Panels using drag n drop, and I want to do this graphically by actually drawing the inner Panel being dragged around, instead of just the default DragDropEffects graphics. But I can't seem to get this to work... What I tried is when you click on an inner Panel you acitvate a DragNDrop with...
9
2992
by: Peter Webb | last post by:
I want to animate one object moving in front of another. I cannot re-render the background as the object moves, as it would be extremely time consuming. This is what I would like to do. I draw the background to a Graphics object, copy it, draw the front object on the original, render it to the screen, then reload the copy (Clone?) of the background for the next loop. I couldn't find any way of doing this directly, and if there is I...
12
1927
by: =?Utf-8?B?TWFyaw==?= | last post by:
I modified a C# application from Bob Powell that moves graphics primitives around on the screen into a Vb.NET 2005 application. I want to modify this application so along with moving regular geometric shapes, I can also move the alphanumeric characters as well. For example I place the character "A" on the screen and when I point to it with the mouse the character will be outlined and while holding down the left mouse button move the "A"...
0
3037
by: raylopez99 | last post by:
Hi, I'm getting into GDI+ Forms 2.0 graphics for C#3 using Visual Studio 2008. One thing I notice: the graphics are really slow and flicker on a Pentium IV, with 2 GB RAM, even with doublebuffering turned on. I did learn tricks such as not invalidating everything, but just the control that is part of the form you are working on (i.e.,
0
9519
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,...
0
10435
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
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
9037
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...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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
3721
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.