A simple question RE: Timers

PolyBezier Mesh Rectangle and timers

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

31 Replies - 1901 Views - Last Post: 06 March 2009 - 09:35 AM Rate Topic: -----

#1 blkbagger  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 28-February 09

A simple question RE: Timers

Posted 05 March 2009 - 10:55 AM

Hi everyone, I have designed a custom user control with a quad poly-bezier mesh rectangle as it's base object... I am fairly new to programming with Visual Studio, but have been playing with VB6 for a long time...

I am an engineer, not a programmer, I can design almost anything, Infact I'm writing my poly-bezier Mesh rectangle class as the first project I'd like to share...

The object is done... I know all I need to know about "IT" I want to bring it to life now and then create an array and copy it etc.... transforms etc...

Unfortunately I stumble on the simplest VB programming issues... BUT I can handle some of the toughest design issues and graphics... I have to tell everyone I have never used a timer for anything except my mercury button...

These are some very cool objects to play with and I finally have the horsepower to do it... I need a little help though...

Here's a sample
Friend WithEvents Timer As System.Windows.Forms.Timer
	Private Function Timer_tick(ByVal X As Integer, ByVal Y As Integer)
		Dim Cpnt8 As New PointF(CType(X, Integer), CType(Y, Integer))
		Cpnt8.X = 75
		Cpnt8.Y = 150
		For every tick of Me.Timer Move CPnt8.X -25 Then back again
			For every tick of Me.Timer Move Cpnt8.Y +25 Then Back again
			Next Tick

			Return ((Cpnt8))

	End Function


I cannot make it work, I know I am close "the pseudo-code" above is not close, it just demonstrates what I want to do... I have 8 variables I'd like to control at runtime(IE: the poly mesh objects control points..) As soon as I get a handle on the control points at runtime I will share my code with all of you here...
8 control point(16 integers) in a textbox, with a timer etc... that's my next step... I'm stumbling(not ashamed to ask for help)

Anyone...??? Ken
Here's some images...

Posted Image
Posted Image
Posted Image

This post has been edited by blkbagger: 05 March 2009 - 11:16 AM


Is This A Good Question/Topic? 0
  • +

Replies To: A simple question RE: Timers

#2 blkbagger  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 28-February 09

Re: A simple question RE: Timers

Posted 05 March 2009 - 11:59 AM

I have vision, I know I what I can do with it, I am just having a hard time with all of this, I have learned most of this in Visual sudio in about three weeks, so I think I've not done too bad...

Here's another image with an idea, maybe someone could help me with...
When this is done I will share it all openly and freely... Sorry about the crude drawing, picture the zones concentric and evenly spaced, perhaps some kind of distance mouse/to control point ratio governing the movement of the control points...

Posted Image

Thanks in advance...
Was This Post Helpful? 0
  • +
  • -

#3 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2257
  • View blog
  • Posts: 9,448
  • Joined: 29-May 08

Re: A simple question RE: Timers

Posted 05 March 2009 - 12:11 PM

I going to do the example for control point 1, from which you can apply for the other.
Create a user control
Public Class UserControl1
 Protected m_ControlPoint1 As Point
 < _
  System.ComponentModel.Category("Control Points") _
  , System.ComponentModel.DisplayName("Control Point1") _
  , System.ComponentModel.Description("Changes the position of Control Point1") _
  > Public Property ControlPoint1() As Point
  Get
   Return m_ControlPoint1
  End Get
  Set(ByVal value As Point)
   m_ControlPoint1 = value
   RedrawControlPoints()
  End Set
 End Property

 Public Sub RedrawControlPoints()
' 
' The Code the draws the shape place.
'

 End Sub
End Class


Add the other control points as properties of the user control. Build the project.
Now if go back to the form set the SelectedObject property of the Property grid to the user control.

Now when you run the project you can enter position values for the control point and it draw the corresponding shape.
Was This Post Helpful? 0
  • +
  • -

#4 blkbagger  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 28-February 09

Re: A simple question RE: Timers

Posted 05 March 2009 - 12:31 PM

Public Class UserControl1
		Protected Cntrl1 As Point
		< _
		  System.ComponentModel.Category("Control Points") _
		  , System.ComponentModel.DisplayName("Control Point1") _
		  , System.ComponentModel.Description("Changes the position of Control Point1") _
		  > Public Property Cntrl_1(ByVal X As Integer, ByVal Y As Integer) As Point
			Get
				Return Cntrl1
			End Get
			Set(ByVal value As Point)
				Cntrl1 = value
				RedrawControlPoints()
			End Set
		End Property

		Public Sub RedrawControlPoints()
			' 
			' The Code the draws the shape place.
			'

		End Sub
	End Class






Well, thank you so very much for your time and help...

Here's what I have so far, where I get lost is passing two values X,Y in the get set...

my "dim"ed items in the main class are cntrl_1, cntrl_2, etc...

I do sincerely appreciate everyones help... I have just couple questions, I want these properties to be right in the main class of my Control, do I add it as another class file or can I subdivide the main class in one file??? Please pardon my ignorance, I have a limited understanding of the class hierarchy and how it it is written to be one control...

This post has been edited by blkbagger: 05 March 2009 - 12:43 PM

Was This Post Helpful? 0
  • +
  • -

#5 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2257
  • View blog
  • Posts: 9,448
  • Joined: 29-May 08

Re: A simple question RE: Timers

Posted 05 March 2009 - 12:52 PM

Forgot add after you've build the project.
If you look in the toolbox there is a new control called usercontrol1 (At the top usually).
Drag and drop onto your main form.
Was This Post Helpful? 0
  • +
  • -

#6 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2257
  • View blog
  • Posts: 9,448
  • Joined: 29-May 08

Re: A simple question RE: Timers

Posted 05 March 2009 - 01:06 PM

Heres a better example of user control draws ellipses, simple but it shows the principles.
Public Class UserControl1
 Protected m_ControlPoint(6) As Point
 < _
  System.ComponentModel.Category("Control Points") _
  , System.ComponentModel.DisplayName("Control Point1") _
  , System.ComponentModel.Description("Changes the position of Control Point1") _
  > Public Property ControlPoint1() As Point
  Get
   Return m_ControlPoint(0)
  End Get
  Set(ByVal value As Point)
   m_ControlPoint(0) = value
   Me.Refresh()
  End Set
 End Property
 < _
  System.ComponentModel.Category("Control Points") _
  , System.ComponentModel.DisplayName("Control Point2") _
  , System.ComponentModel.Description("Changes the position of Control Point2") _
  > Public Property ControlPoint2() As Point
  Get
   Return m_ControlPoint(1)
  End Get
  Set(ByVal value As Point)
   m_ControlPoint(1) = value
   Me.Refresh()
  End Set
 End Property

 Protected IsDragging As Boolean = False
 Protected DraggingPoint As Point = Nothing
 Protected DragPointSquareSize As Integer = 5
 Protected SelectedControlPoint As Integer = -1

 Private Sub UserControl1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
  If e.Button = Windows.Forms.MouseButtons.Left Then
   Dim pcp As Point = e.Location
   Dim mouseR As New Rectangle(pcp.X - DragPointSquareSize, pcp.Y - DragPointSquareSize, DragPointSquareSize * 2, DragPointSquareSize * 2)
   Dim controlPR_1 As New Rectangle(m_ControlPoint(0).Y - DragPointSquareSize, m_ControlPoint(0).Y - DragPointSquareSize, DragPointSquareSize * 2, DragPointSquareSize * 2)
   Dim controlPR_2 As New Rectangle(m_ControlPoint(1).Y - DragPointSquareSize, m_ControlPoint(1).Y - DragPointSquareSize, DragPointSquareSize * 2, DragPointSquareSize * 2)

   Select Case True
	Case mouseR.IntersectsWith(controlPR_1)
	 SelectedControlPoint = 0
	 IsDragging = True
	Case mouseR.IntersectsWith(controlPR_2)
	 SelectedControlPoint = 1
	 IsDragging = True

   End Select
  End If
 End Sub

 Private Sub UserControl1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
  If e.Button = Windows.Forms.MouseButtons.Left Then
   If SelectedControlPoint > -1 Then
	m_ControlPoint(SelectedControlPoint) = e.Location

   End If
   Me.Refresh()
   My.Application.DoEvents()

  End If

 End Sub

 Private Sub UserControl1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
  If e.Button = Windows.Forms.MouseButtons.Left Then
   IsDragging = False
   SelectedControlPoint = -1
  End If


 End Sub

 Private Sub UserControl1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
  e.Graphics.Clear(Color.White)
  Dim sx As Integer = Math.Abs(ControlPoint1.X - ControlPoint2.X) + 1
  Dim sy As Integer = Math.Abs(ControlPoint1.Y - ControlPoint2.Y) + 1
  e.Graphics.DrawArc(Pens.Black, ControlPoint1.X - (sx \ 2), ControlPoint1.Y - (sy \ 2), sx, sy, 0, 360)
  e.Graphics.DrawLine(Pens.Red, ControlPoint1.X - 5, ControlPoint1.Y, ControlPoint1.X + 5, ControlPoint1.Y)
  e.Graphics.DrawLine(Pens.Red, ControlPoint1.X, ControlPoint1.Y - 5, ControlPoint1.X, ControlPoint1.Y + 5)
  e.Graphics.DrawLine(Pens.Red, ControlPoint2.X - 5, ControlPoint2.Y, ControlPoint2.X + 5, ControlPoint2.Y)
  e.Graphics.DrawLine(Pens.Red, ControlPoint2.X, ControlPoint2.Y - 5, ControlPoint2.X, ControlPoint2.Y + 5)

 End Sub



Was This Post Helpful? 0
  • +
  • -

#7 blkbagger  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 28-February 09

Re: A simple question RE: Timers

Posted 05 March 2009 - 01:47 PM

View PostAdamSpeight2008, on 5 Mar, 2009 - 12:06 PM, said:

Heres a better example of user control draws ellipses, simple but it shows the principles.


Adam, I edited my code and added what you posted here, please contact me at yahee . com blkbagger06 I'd like to send you a couple things to play with...

Maybe you can have some fun...

I have not fired up what you posted yet... You have no idea how much I apprecitate your help...

This post has been edited by blkbagger: 05 March 2009 - 01:48 PM

Was This Post Helpful? 0
  • +
  • -

#8 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2257
  • View blog
  • Posts: 9,448
  • Joined: 29-May 08

Re: A simple question RE: Timers

Posted 05 March 2009 - 03:20 PM

Corrected a few mistakes in the code
Public Class UserControl1

 Public Const NumberOfControlPoints As Integer = 2 'Must be >=0


 Protected m_PropGrid As PropertyGrid
 < _
  System.ComponentModel.Category("Control Points") _
  , System.ComponentModel.DisplayName("PropertyGrid") _
  , System.ComponentModel.Description("Changes the position of Control Point1") _
  > Public Property PropGrid() As PropertyGrid
  Get
   Return m_PropGrid
  End Get
  Set(ByVal value As PropertyGrid)
   m_PropGrid = value

   Me.Refresh()
  End Set
 End Property
 Private m_ControlPoint(NumberOfControlPoints - 1) As Point
 < _
  System.ComponentModel.Category("Control Points") _
  , System.ComponentModel.DisplayName("Control Point1") _
  , System.ComponentModel.ListBindable(True) _
  , System.ComponentModel.Description("Changes the position of Control Point1") _
  > Public Property ControlPoint() As Point()
  Get
   Return m_ControlPoint
  End Get
  Set(ByVal value As Point())
   m_ControlPoint = value
   Me.Refresh()
  End Set
 End Property

 Protected m_ShowControlPoints As Boolean = True

 < _
 System.ComponentModel.Category("Control Points") _
 , System.ComponentModel.DisplayName("Show ControlPoints") _
 , System.ComponentModel.Description("Show ControlPoints") _
 > Public Property ShowControlPoints() As Boolean
  Get
   Return m_ShowControlPoints
  End Get
  Set(ByVal value As Boolean)
   m_ShowControlPoints = value
   Me.Refresh()
  End Set
 End Property
 Private DragPointSquareSize As Integer = 10
 Private SelectedControlPoint As Integer = -1

 Private Sub UserControl1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
  If e.Button = Windows.Forms.MouseButtons.Left Then
   Dim mouseR As New Rectangle(e.X, e.Y, 2, 2)
   Dim control_pr As Rectangle
   For i As Integer = 0 To NumberOfControlPoints - 1
	control_pr = New Rectangle(ControlPoint(i).X - DragPointSquareSize, ControlPoint(i).Y - DragPointSquareSize, DragPointSquareSize * 2, DragPointSquareSize * 2)
	If control_pr.IntersectsWith(mouseR) Then
	 Me.SelectedControlPoint = i
	 Exit For
	End If
   Next
   control_pr = Nothing
   mouseR = Nothing
  End If
 End Sub

 Private Sub UserControl1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
  If e.Button = Windows.Forms.MouseButtons.Left Then
   If Me.SelectedControlPoint >= 0 Then
	ControlPoint(Me.SelectedControlPoint) = e.Location
	Me.Refresh()

	m_PropGrid.Refresh()

   End If

  End If
  My.Application.DoEvents()

 End Sub

 Private Sub UserControl1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
  If e.Button = Windows.Forms.MouseButtons.Left Then
   If Me.SelectedControlPoint >= 0 Then
	m_ControlPoint(Me.SelectedControlPoint) = e.Location
   End If
   Me.Refresh()
   m_PropGrid.Refresh()
  End If
  SelectedControlPoint = -1
 End Sub

 Private Sub UserControl1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint

  e.Graphics.Clear(Color.White)
  Dim sx As Integer = Math.Abs(ControlPoint(0).X - ControlPoint(1).X) + 1
  Dim sy As Integer = Math.Abs(ControlPoint(0).Y - ControlPoint(1).Y) + 1
  e.Graphics.DrawArc(Pens.Black, ControlPoint(0).X - (sx \ 2), ControlPoint(0).Y - (sy \ 2), sx, sy, 0, 360)
  If m_ShowControlPoints Then
   e.Graphics.DrawRectangle(Pens.Red, ControlPoint(0).X - (DragPointSquareSize \ 2), ControlPoint(0).Y - (DragPointSquareSize \ 2), DragPointSquareSize, DragPointSquareSize)
   e.Graphics.DrawRectangle(Pens.Red, ControlPoint(1).X - (DragPointSquareSize \ 2), ControlPoint(1).Y - (DragPointSquareSize \ 2), DragPointSquareSize, DragPointSquareSize)
  End If
 End Sub

End Class



Was This Post Helpful? 0
  • +
  • -

#9 blkbagger  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 28-February 09

Re: A simple question RE: Timers

Posted 05 March 2009 - 03:30 PM

Adam, I appreciate all of your efforts...

Here's where I am at, the properties now show up in the propertu grid, the problem as I said before is in the multilple variables... (X.Y) being passed as integers in the set/get...

My usercontrol is named

Public Class bPpolyMesh

I have "Cntrl1 thru Cntrl8 "dim" ed they are the control points (PointF) that I am concerned with... Everything you have provided is great schtuff... For this project, one step at a time... Before I can master a matrix of four or more of these animals I need to master my first down to the pixel and second...

Protected m_Cntrl(8) As Point
	< _
	  System.ComponentModel.Category("Control Points") _
	  , System.ComponentModel.DisplayName("Control Point 1") _
	  , System.ComponentModel.Description("Changes the position of Control Point 1") _
	  > Public Property Cntrl1() As Point
		Get
			Return m_Cntrl(0)
		End Get
		Set(ByVal value As Point)
			m_Cntrl(0) = value
			Me.CreateGraphics()
		End Set
	End Property


I feel like such a dummy, I have looked at this for a week, I get syntax errors or nothing actually happens when the values are changed... Dragging the control points with a mouse will be great, but this functionality needs to be automated to respond to events such as mouse clicks ect...

This post has been edited by blkbagger: 05 March 2009 - 03:32 PM

Was This Post Helpful? 0
  • +
  • -

#10 myork  Icon User is offline

  • D.I.C Head

Reputation: 41
  • View blog
  • Posts: 129
  • Joined: 04-March 09

Re: A simple question RE: Timers

Posted 05 March 2009 - 03:43 PM

If you want to pass multiple variables to a property/sub/function, you could wrap them in a structure that contains the two variables, or you could use an array.

	Structure intHolder
		Dim int1 As Integer
		Dim int2 As Integer
	End Structure

	Dim myIntHolder As intHolder

	Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		myIntHolder.int1 = 1
		myIntHolder.int2 = 2
		recievingSub(myIntHolder)
	End Sub

	Sub recievingSub(ByVal holder As intHolder)
		MsgBox(holder.int1 + holder.int2)
	End Sub



or

	Dim array() As Integer

	Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
		array = New Integer() {1, 2}
		recievingSub(array)
	End Sub

	Sub recievingSub(ByVal ints As Integer())
		MsgBox(ints(0) + ints(1))
	End Sub


Was This Post Helpful? 0
  • +
  • -

#11 blkbagger  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 28-February 09

Re: A simple question RE: Timers

Posted 05 March 2009 - 04:14 PM

View Postmyork, on 5 Mar, 2009 - 02:43 PM, said:

If you want to pass multiple variables to a property/sub/function, you could wrap them in a structure that contains the two variables, or you could use an array.

	Structure intHolder
		Dim int1 As Integer
		Dim int2 As Integer
	End Structure

	Dim myIntHolder As intHolder

	Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		myIntHolder.int1 = 1
		myIntHolder.int2 = 2
		recievingSub(myIntHolder)
	End Sub

	Sub recievingSub(ByVal holder As intHolder)
		MsgBox(holder.int1 + holder.int2)
	End Sub



or

	Dim array() As Integer

	Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
		array = New Integer() {1, 2}
		recievingSub(array)
	End Sub

	Sub recievingSub(ByVal ints As Integer())
		MsgBox(ints(0) + ints(1))
	End Sub


Was This Post Helpful? 0
  • +
  • -

#12 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2257
  • View blog
  • Posts: 9,448
  • Joined: 29-May 08

Re: A simple question RE: Timers

Posted 05 March 2009 - 04:17 PM

View Postblkbagger, on 5 Mar, 2009 - 09:30 PM, said:

Adam, I appreciate all of your efforts...

Here's where I am at, the properties now show up in the propertu grid, the problem as I said before is in the multilple variables... (X.Y) being passed as integers in the set/get...

What are Integers used for?

View Postblkbagger, on 5 Mar, 2009 - 09:30 PM, said:

I feel like such a dummy, I have looked at this for a week, I get syntax errors or nothing actually happens when the values are changed...

Look the last example I posted, the ellipse is drawn in the Paint Event.
Me.Refresh Triggers that event inside the usercontrol.
Was This Post Helpful? 0
  • +
  • -

#13 blkbagger  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 28-February 09

Re: A simple question RE: Timers

Posted 05 March 2009 - 04:21 PM

YES, YES, YES, an Array is exactly what I want to do, but first, I need to master this beastie I've created... I do understand the 3rd order point structures very well, I wish I was as well versed in VB... I am sorry, But until I crack this, I am not going to just post all of this code...

OK, I had one control point working from the property grid and as soon as I tried to get the second control point property section to look like the first, I got exception errors...

 Protected m_Cntrl1 As Point
	< _
	  System.ComponentModel.Category("Control Points") _
	  , System.ComponentModel.DisplayName("Control Point 1") _
	  , System.ComponentModel.Description("Changes the position of Control Point 1") _
	  > Public Property Cntrl1() As Point
		Get
			Return m_Cntrl1
		End Get
		Set(ByVal value As Point)
			m_Cntrl1 = value
			Me.CreateGraphics()
		End Set
	End Property
	Protected m_Cntrl2 As Point
	< _
	  System.ComponentModel.Category("Control Points") _
	  , System.ComponentModel.DisplayName("Control Point 2") _
	  , System.ComponentModel.Description("Changes the position of Control Point 2") _
	  > Public Property Cntrl2() As Point
		Get
			Return m_Cntrl2
		End Get
		Set(ByVal value As Point)
			m_Cntrl2 = value
			Me.CreateGraphics()
		End Set
	End Property
	Protected m_Cntrl3 As Point
	< _
		  System.ComponentModel.Category("Control Points") _
		  , System.ComponentModel.DisplayName("Control Point 3") _
		  , System.ComponentModel.Description("Changes the position of Control Point 3") _
		  > Public Property Cntrl3() As Point
		Get
			Return m_Cntrl3
		End Get
		Set(ByVal value As Point)
			m_Cntrl3 = value
			Me.CreateGraphics()
		End Set
	End Property
	Protected m_Cntrl4 As Point
	< _
	  System.ComponentModel.Category("Control Points") _
	  , System.ComponentModel.DisplayName("Control Point 4") _
	  , System.ComponentModel.Description("Changes the position of Control Point 4") _
	  > Public Property Cntrl4() As Point
		Get
			Return m_Cntrl4
		End Get
		Set(ByVal value As Point)
			m_Cntrl4 = value
			Me.CreateGraphics()
		End Set
	End Property
	Protected m_Cntrl5 As Point
	< _
	  System.ComponentModel.Category("Control Points") _
	  , System.ComponentModel.DisplayName("Control Point 5") _
	  , System.ComponentModel.Description("Changes the position of Control Point 5") _
	  > Public Property Cntrl5() As Point
		Get
			Return m_Cntrl5
		End Get
		Set(ByVal value As Point)
			m_Cntrl5 = value
			Me.CreateGraphics()
		End Set
	End Property
	Protected m_Cntrl6 As Point
	< _
	  System.ComponentModel.Category("Control Points") _
	  , System.ComponentModel.DisplayName("Control Point 6") _
	  , System.ComponentModel.Description("Changes the position of Control Point 6") _
	  > Public Property Cntrl6() As Point
		Get
			Return m_Cntrl6
		End Get
		Set(ByVal value As Point)
			m_Cntrl6 = value
			Me.CreateGraphics()
		End Set
	End Property
	Protected m_Cntrl7 As Point
	< _
		  System.ComponentModel.Category("Control Points") _
		  , System.ComponentModel.DisplayName("Control Point 7") _
		  , System.ComponentModel.Description("Changes the position of Control Point 7") _
		  > Public Property Cntrl7() As Point
		Get
			Return m_Cntrl7
		End Get
		Set(ByVal value As Point)
			m_Cntrl7 = value
			Me.CreateGraphics()
		End Set
	End Property
	Protected m_Cntrl8 As Point
	< _
	  System.ComponentModel.Category("Control Points") _
	  , System.ComponentModel.DisplayName("Control Point 8") _
	  , System.ComponentModel.Description("Changes the position of Control Point 8") _
	  > Public Property Cntrl8() As Point
		Get
			Return m_Cntrl8
		End Get
		Set(ByVal value As Point)
			m_Cntrl8 = value
			Me.CreateGraphics()
		End Set
	End Property


If anyone can sort that mess out, my code will be up two minutes later...

Thanks for all your help everyone, I do need help with the Array situation after this , most certainly... I want to drag and drop copies of this beastie... I even know how the grid needs to be done, I have studied point structures for quite a while... You all need to understand I am doing this for fun... Not $$$

This post has been edited by blkbagger: 05 March 2009 - 04:24 PM

Was This Post Helpful? 0
  • +
  • -

#14 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2257
  • View blog
  • Posts: 9,448
  • Joined: 29-May 08

Re: A simple question RE: Timers

Posted 05 March 2009 - 04:24 PM

Change the Me.CreateGraphics()s to Me.refresh
Then in the Paint Event of the UserControl do what need to do to draw the shape.
Was This Post Helpful? 0
  • +
  • -

#15 blkbagger  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 28-February 09

Re: A simple question RE: Timers

Posted 05 March 2009 - 04:33 PM

View PostAdamSpeight2008, on 5 Mar, 2009 - 03:24 PM, said:

Change the Me.CreateGraphics()s to Me.refresh
Then in the Paint Event of the UserControl do what need to do to draw the shape.


That is how I had it, I changed it to creategraphics and had my first results, I am a little confused on whether I should be using "OnPaint" or "Handles MyBase.Paint"

And again You have no idea how much I appreciate all this help...

I wanted to have my project seperated into several sections ie: construction, drawing, paint and design, then all the runtime and event based schtufff....

the section which builds this structure is the largest...
Ken
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3