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

RubberBanding Drawing in VB.NET on Win8/10

DTeCH
23
Hey dudes :)

Ok, First thing first... I have not tried this on Win8, so just an assumption at the moment.

The Following code works on XP(SP3), Vista, & Win7 so far, but after giving my app to a friend who was suckered into Win10 because of the "Free" deal, says it's no longer working. The Applicatiuon runs, but doesnt work, & throws No Errors whatsoever.

RubberBanding Code:
Expand|Select|Wrap|Line Numbers
  1.     Private _RubberBandingOn As Boolean = False
  2.     Private _Start As New Point
  3.     Private _Stop As New Point
  4.     Private _Now As New Point
  5.     Private _rRectangle As New Rectangle
  6.  
  7.     Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
  8.         PictureBox2.Visible = False
  9.  
  10.         Me._RubberBandingOn = Not _RubberBandingOn
  11.  
  12.         If Me._RubberBandingOn Then
  13.  
  14.             If _Start = Nothing Then _Start = New Point
  15.  
  16.             _Start.X = e.X
  17.             _Start.Y = e.Y
  18.             _Now.X = e.X
  19.             _Now.Y = e.Y
  20.  
  21.         End If
  22.  
  23.         Me.Invalidate()
  24.     End Sub
  25.  
  26.     Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
  27.         If Me._RubberBandingOn Then
  28.             If _Now = Nothing Then _Now = New Point
  29.  
  30.             Me._Now.X = e.X
  31.             Me._Now.Y = e.Y
  32.             Me.Invalidate()
  33.         End If
  34.         Me.Cursor = Cursors.Cross
  35.         Me.ToolTip1.SetToolTip(Me, e.X.ToString & ", " & e.Y.ToString)
  36.     End Sub
  37.  
  38.     Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
  39.  
  40.         Me._RubberBandingOn = Not Me._RubberBandingOn
  41.  
  42.         If Not Me._RubberBandingOn Then
  43.  
  44.             If _Stop = Nothing Then _Stop = New Point
  45.  
  46.             _Stop.X = e.X
  47.             _Stop.Y = e.Y
  48.  
  49.             Me.Invalidate()
  50.  
  51.             If _rRectangle.Width > 20 AndAlso _rRectangle.Height > 20 Then
  52.  
  53.                 PictureBox2.Location = _rRectangle.Location
  54.                 PictureBox2.Size = _rRectangle.Size
  55.                 PictureBox2.Visible = True
  56.  
  57.             Else
  58.                 GC.Collect()
  59.             End If
  60.         End If
  61.     End Sub
Can someone here shed some light on what could be wrong, or about any removals, or deprecation of code from Microsoft, or GDI+/GDI changes, or whatever that could have caused this? Maybe Win8/10 has a brand new way of drawing that I'm not aware of?

Any help is awesome as usual.
Thanks.

DTeCH
Oct 23 '15 #1
0 1146

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

Similar topics

0
by: Tomi Holger Engdahl | last post by:
I am looking for a solution to add on-line drawing tool to a phpBB discussion board. The idea would be that the users can draw their own simple drawings with the tool and attach them easily as...
2
by: Champika Nirosh | last post by:
Hi, I want to create drawing board application that can draw Line, rectagle, circle and free hand drawing. Each drawing need to be transparent, moveable (draggable), have bring to front and...
1
by: Hadar | last post by:
Hi, I'm getting "object is currently in use elsewhere" when I use System.Drawing.Graphics.MesureString. This is what I do: My controls use a utility class the helps it to mesure strings. To...
7
by: Marc Pelletier | last post by:
Hello all, I have a class which includes a method to create a chart. I want to be able to call this method from asp.net code as well as windows application code, so I have sketched it out as...
5
by: Jerry J | last post by:
I want to use the System.Drawing.Image class. According to the help file, this is an abstract base class. Because it is supposedly abstract, I created another class that inherits from it. However,...
2
by: ThatsIT.net.au | last post by:
I have this code that writes a pie chart in a asp.net page, but I want to use it in a server control. When I try I get a error on the last line "Response.OutputStream" Obviously there is no...
7
by: raylopez99 | last post by:
I have a logical drawing space much bigger than the viewport (the screen) and I'd like to center the viewport (the screen) to be at the center of the logical drawing space. After following the...
5
Tyler Wiebe
by: Tyler Wiebe | last post by:
Okay, I have a few questions about auto drawing a Texture2D, to be used in an 2D Windows Game I'm making for the fun of it. But first, a few things, 1: The code is in my own custom .dll file...
1
by: tvnaidu | last post by:
I have Two questions, sorry if it is some basic. 1) I did received .lib (library) file compiled with Visual studio 2012 (VS2012), I have some application compiled with VS2008, can I use that .lib...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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:
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...
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,...
0
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...
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...

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.