|
If I unserstand correctly you wish to store a list of Points so you could have something list this :-
Public Class PointHistory
Private _myPoints As List(Of System.Drawing.Point)
Public ReadOnly Property Count()
Get
Return _myPoints.Count
End Get
End Property
Public ReadOnly Property Point(ByVal Index As Integer) As System.Drawing.Point
Get
Return _myPoints(Index)
End Get
End Property
Public ReadOnly Property CurrentPoint() As System.Drawing.Point
Get
Return _myPoints(Count)
End Get
End Property
Public Sub Add(ByVal NewPoint As System.Drawing.Point)
_myPoints.Add(NewPoint)
End Sub
End Class
wilson_borda wrote: Sorry but my english is terrible!!!
Never applogies for trying.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Thanks... My class "point" don't refers to drawing.point. My second choice is use a List or Collection implementation. Now I try to do this. But, in some parts of my code (not showed in the previous msg) is very dificult use List instead of a structure like my class...
|
|
|
|
|
Is the modified class below, more like what you are after?
Public Class PointHistory
Public Structure Point
Dim x As Int32
Dim y As Int32
End Structure
Private _myPoints As List(Of Point)
Public ReadOnly Property Count()
Get
Return _myPoints.Count
End Get
End Property
Public ReadOnly Property Point(ByVal Index As Integer) As Point
GetReturn _myPoints(Index)
End Get
End Property
Public ReadOnly Property CurrentPoint() As Point
Get
Return _myPoints(Count)
End Get
End Property
Public Sub Add(ByVal NewPoint As Point)
_myPoints.Add(NewPoint)
End Sub
Public Sub Add(ByVal x As Int32, ByVal y As Int32)
Dim newPoint as Point
newPoint.x = x
newPoint.y = y
_myPoints.Add(newPoint)
End Sub
End Class
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Yes, this is the idea. However, I have to modify my code because class "PointHistory" don't have recursive property like (a class inside the same class):
public class point
dim x,y as double
dim pl,pr as point
end class
I call like this
dim p0 as new point
p0.pl.pl...x=...
Now I use
dim hist as new pointhistory
... initialize hist (add points)
dim p0 as new pointhistory.point
p0=hist.pont(index)
....
Thanks again...
|
|
|
|
|
wilson_borda wrote: dim p0 as new pointhistory.point
p0=hist.pont(index)
Don't use the new keyword when you only want to declare a reference, as that will create an instance of the class. As you assign a new instance to the reference in the next line, the newly created instance will just be thrown away.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Public Class Point
Public x as Double
Public y as Double
End Class
Dim pts as new LinkedList(Of Point)
If you are converting the code, use all the features of your new platform. I'd even argue that you should use the PointF struct provided by the framework. I'm messing around writing game engines at the moment, and theres nothing more annoying than every damn library having their own version of Vector3 and Matrix.
|
|
|
|
|
Hi,
I am getting out of memory exception when I run my project Build. While resizing the forms and minimize/maximize the forms I am getting the Out of memory exception and sometimes application terminationg also.
As per my observation this error is coming when I am working with many open applications and long time continuously.
Will it be a code problem or any application or build settings we need to set?
Please let us know. This is very urgent for us very impartent.
Thanks in Advance,
AR Reddy
|
|
|
|
|
I was getting the same thing here using VS2008. We upped the RAM to 3 Gig in the box I'm using, and I only build when most code and design screens are closed, and never with any Crystal Reports open in the IDE.
Good Luck!
--------------------------------------------------------
Knowledge is knowing that the tomato is a fruit.
Wisdom is not putting it in fruit salad!!
|
|
|
|
|
|
Open a command prompt and type:
CD "%USERPROFILE%\Local Settings\Temporary Internet Files"
DIR /A /S /P
Here, you'll find the real directory structure under that alias. These are the paths you use to copy files from.
|
|
|
|
|
Hi.
My company is running Office Communicator 2007 for IM. Thie tool has one issue, which I'm trying to resolve. When you try to message to offline people the message will never be delivered. I'm not sure why this functionality is not there, especially when MSN LIVE does have this feature.
I need to find the way to identify people offline and store the message in DB so then they sign in to Communicator that stored message could be retreived and delivered to them. As you can see there are 2 requirements for this job. 1. Store message if user offline 2. Retreive and deliver message when user signs in.
How can I accomplish that? Is Office Communications Server 2007 SDK the answer?
Did any body had experince in programming for Office Communications Server 2007?
Thanks a lot.
|
|
|
|
|
alexfromto wrote: How can I accomplish that?
I have no idea since I've never written anything for Communicator.
alexfromto wrote: Is Office Communications Server 2007 SDK the answer?
More than likely.
|
|
|
|
|
Hi All!
I'm struggling a bit with auto indenting HTML in my application. I have tried TidyCOM (HTML Tidy) but upon encountering an error in the HTML it just stops and outputs nothing. How Annoying for my end-users.
I've tried making my own HTML auto indent function but after weeks of trying I just can't do it! Does anybody know of a convenient way to auto-indent HTML?
Thanks!
MrWolfy
|
|
|
|
|
You might want to start with Googling for "HTML Pretty control".
|
|
|
|
|
Hi and Thanks!
I tried... but couldn't find anything that looked suitable. Am I looking in the wrong places? Can you recommend anything in particular?
Thanks Again!
MrWolfy
|
|
|
|
|
I've never used any libraries that do "prettying" of HTML. I've never had the need to do it.
|
|
|
|
|
Hi all...
I am using VB6 as program and MS Access 2003 as Daabase.
I want to know that how to connect to database using VB6
what are the procedures,what is the connection string is used to connect to database.
If posible give me an example.
Thanks.
Gagan
|
|
|
|
|
Gagan.20 wrote: I am using VB6 as program and MS Access 2003 as Daabase.
I want to know that how to connect to database using VB6
what are the procedures,what is the connection string is used to connect to database.
If posible give me an example.
A few things...
1) You need to learn how to use Google
2) ConnectionStrings.com is a very good resource
3) Why are you writing a new app in VB6 now?
|
|
|
|
|
...
Blog link to be reinstated at a later date.
|
|
|
|
|
hi,
How can I find the minimum margins for a printdocument
e.PageSettings.Margins gives me the actual settings but not the absolut minimum
Jan
|
|
|
|
|
I believe minimum margins depends upon the specific printer, and if that is the case then I don't think the .NET framework would not be able to pull the minimum margin information from the printer.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Thats correct. thats why I need to know how I can find the min margins. I want to use all the space on the paper I can. so if I print on location 0,0 and the printer starts on 15,25 I will mis some text/picture.
Jan
|
|
|
|
|
not shure about this but
If you open up a printdialog window I think it contains the minimum margins off the printer, check the printersettings property and pagesettings property of the dialog.
If you don't want to display the window you can open it in the background set the correct printer simulate a OK click and get the margins like that.
|
|
|
|
|
|
once I found it that way. I also found a better way
e.PageSettings.HardMarginX
e.PageSettings.HardMarginY
and PrinterSettings.DefaultPageSettings.PrintableArea.width/height
|
|
|
|