473,406 Members | 2,954 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,406 software developers and data experts.

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.drawreversibleframe 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
drawingreversibleframe 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 1699
Hi,

Check out Carl Franklins SelectForm.Zip example.

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

Ken
--------------------
"Sam" <qd*@datawave.ca> wrote in message
news:un**************@tk2msftngp13.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.drawreversibleframe 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
drawingreversibleframe 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
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. ...
2
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...
2
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...
6
by: Jim Hubbard | last post by:
Anybody seen an example of a snap-in GUI done in VB.Net?
1
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...
1
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...
9
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...
4
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...
80
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,...
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: 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?
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
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...
0
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...
0
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,...
0
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...

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.