473,695 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

drawing snap mode indicator

Sam
Hi guys

I'm writing a small drawing program which has "snap to grid" mode and I
want to display something (some kind of shapes for example a small square or
circle which indicate the current snap point of my mouse) but I have no
success so far. I tried controlpain.dra wreversiblefram e method to draw a
tiny square to indicate my current snap point of my mouse as it moves on my
grid points; and this somwhat gives me what I want. The problem with this
method is that everytime I call invalidate method of my picturebox(my
drawing surface), there will be one extra square drawn by
drawingreversib leframe method. This solution is even worse when it comes to
resizing form because the controlpaint method has no restriction within my
drawing surface.

Does anyone have any other ideas to implement this? In VB6 I used a shape
control and set its background to transparent property and this gave me what
I want. I was thinking to use a drawing square method of GDI+ to implement
this or a small label to serve as an indicator but then I have to call my
control's invalidate method to redraw everything as my mouse moves but this
is not efficient way to do.

Regards,

Sam
Nov 21 '05 #1
1 1717
Hi,

Check out Carl Franklins SelectForm.Zip example.

http://www.franklins.net/dotnet/

Ken
--------------------
"Sam" <qd*@datawave.c a> wrote in message
news:un******** ******@tk2msftn gp13.phx.gbl...
Hi guys

I'm writing a small drawing program which has "snap to grid" mode and I
want to display something (some kind of shapes for example a small square or
circle which indicate the current snap point of my mouse) but I have no
success so far. I tried controlpain.dra wreversiblefram e method to draw a
tiny square to indicate my current snap point of my mouse as it moves on my
grid points; and this somwhat gives me what I want. The problem with this
method is that everytime I call invalidate method of my picturebox(my
drawing surface), there will be one extra square drawn by
drawingreversib leframe method. This solution is even worse when it comes to
resizing form because the controlpaint method has no restriction within my
drawing surface.

Does anyone have any other ideas to implement this? In VB6 I used a shape
control and set its background to transparent property and this gave me what
I want. I was thinking to use a drawing square method of GDI+ to implement
this or a small label to serve as an indicator but then I have to call my
control's invalidate method to redraw everything as my mouse moves but this
is not efficient way to do.

Regards,

Sam

Nov 21 '05 #2

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

Similar topics

2
6827
by: Rhonda | last post by:
Using AccessXP I have lost snap to grid on my system. New or existing databases do not snap to grid for forms and reports in design view. Anyone have an idea on how to get it back?? Thanks. Rhonda
2
1572
by: Vishruth | last post by:
I would like to know how to plot coordinates in the form using drawline method .For eg: Given only x and y fields and about 50 records are there in database .I should fetch the records from database and plot it in the form given only x and Y coordinates. please help me to tackle this problem.
2
4985
by: SStory | last post by:
I have a picture that I allow the user to move around and would like to offer grid support like VB and other apps so that it will snap to the nearest point. How can I offer grid support so that the image will snap in place on grid points like a commerical app? I am not sure how to implement that. Anyone have any code? Thanks,
6
4532
by: Jim Hubbard | last post by:
Anybody seen an example of a snap-in GUI done in VB.Net?
1
3823
by: Marc Gravell | last post by:
For a bespoke control, how can I implement my own designer snap lines in VS2005? I remember finding an MS article once, but I now can't re-locate it. Basically, I have a custom-control that comprises e.g. a TextBox and some other things; I don't want to do anything too clever - I just want to forward the snap-lines on my control to inherit those from the TextBox, mainly for the "bottom of the text" snap line (for want of a better term) -...
1
1585
by: Driez | last post by:
I recently installed .Net Framework 2.0 on my computer. I have developed a snap in c# using a library from sourceforge (http://sourceforge.net/projects/mmclibrary/) on Visual Studio 2003 When I run my MMC project in debug mode from Visual Studio 2003 the mmc starts up but crahes immediately. An hourglass appears and then the MMC crashes. I have set up my project settings to start the program mmc.exe with a command line argument of...
9
1865
by: liorm | last post by:
Hi folks, I need to write a short program which gets a few parameters and draws a diagram in the text file. Basically what I need is a guidance on how I put stream indicator to the required position. What I mean is that I need to draw a character at the (x,y) coordinate. But how do I bring the indicator to this position. I tried to use fsetpos(fp, y*80+x) but then when I draw the character by fputs("_",fp) I see it on the first line...
4
5469
by: Billy Bob | last post by:
Hi, Is it possible like Visual Basic that when you are in Design mode so you can add controls etc to a windows form that you can draw on it? like draw a line or a shape? Bob *** Sent via Developersdex http://www.developersdex.com ***
80
6467
by: nicolas.sitbon | last post by:
Hi everybody, in a french C book, the author says that only {fgetc, getc, getchar, fgetwc, getwc, getwchar, fgets, gets, fgetws, getws, fputc, putc, putchar, fputwc, putwc, putwchar, fputs, puts, fputws} are guaranteed to set the end-of-file indicator when the end-of-file is reached, but in C99 standard, I find p 288 (ISO/IEC 9899:TC3 Committee Draft — Septermber 7, 2007 WG14/N1256) /* ============================= */ #include <stdio.h>...
0
8562
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
8820
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
7655
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
6488
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
5837
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
4339
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...
1
2997
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
2265
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1971
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.