|
Hi Dave,
That is the first approach a tried, but timers within the system.threading namespace
do not have the STOP, START methods of timers within the system.timer namespace.
I then tried using the CHANGE method of this timer to replicate the same behavior, but the app did not like that at all. Apparently what it did was to generate new threads of the timer thus consuming all CPU resources.
I chose the system.threading namespace timer, because I understood this class automatically run the timer in the system provided thread.
The app has two other timers that fire each at different intervals and I have noticed that some times two or all three of them present the same issue.
Hope this helps you to help me
Thanks for your time.
Alex.
|
|
|
|
|
alexvw wrote: That is the first approach a tried, but timers within the system.threading namespace
do not have the STOP, START methods of timers within the system.timer namespace.
Whoops. You're right. So, then destroy the timer and create a new one.
|
|
|
|
|
Hi Dave,
I will try that approach!
thanks.
Alex.
|
|
|
|
|
i m making paint and brush in vb.net, the problem is when i draw any graphic (eg.- line rectanle, e.t.c), on my picture box, the graphic get unsaved on the image, as soon as i do another action i.e- click anwhere else on pic box, minimization of working window...
then drawing done get erased...
now i want u to help me in saving the previously done drawing on the pic box "image"
i m a bigginer, please help me!!!
With regards
Vineet Swami
Isol
Vineet Swami
Isol
|
|
|
|
|
This problem tells me that your not managing drawing properly. All drawing has to be done in your OnPaint event. You can get away with drawing from outside the OnPaint event, but only temporarily. Once Windows tells the control to redraw itself, you'll lose all the painting you've done outside of OnPaint.
What you have to do is once you get done "drawing" with the mouse, all the changes you just made have to be drawn on a bitmap object so that you have the changes saved and they can be redrawn at any time by the code in the OnPaint event.
|
|
|
|
|
here is not any OnPaint event, i have paint event and that not work properly this is coading of this event
Private Sub PicBox_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PicBox.Paint
If brect = 1 Or bellipse = 1 Or bline = 1 Then
x2 = Cursor.Position.X
y2 = Cursor.Position.Y
x = Me.Location.X + 9
y = Me.Location.Y + 57
x2 = x2 - x
y2 = y2 - y
bm = PicBox.Image
Dim tpen As New Pen(frmmain.lblcolfront.BackColor)
If bline = 1 Then
objgraphics.DrawLine(tpen, x1, y1, x2, y2)
End If
If x1 < x2 Then
If y1 < y2 Then
If brect = 1 Then
objgraphics.DrawRectangle(tpen, x1, y1, x2 - x1, y2 - y1)
End If
If bellipse = 1 Then
objgraphics.DrawEllipse(tpen, x1, y1, x2 - x1, y2 - y1)
End If
Else
If brect = 1 Then
objgraphics.DrawRectangle(tpen, x1, y1 - (y1 - y2), x2 - x1, y1 - y2)
End If
If bellipse = 1 Then
objgraphics.DrawEllipse(tpen, x1, y1 - (y1 - y2), x2 - x1, y1 - y2)
End If
End If
Else
If y1 < y2 Then
If brect = 1 Then
objgraphics.DrawRectangle(tpen, x1 - (x1 - x2), y1, x1 - x2, y2 - y1)
End If
If bellipse = 1 Then
objgraphics.DrawEllipse(tpen, x1 - (x1 - x2), y1, x1 - x2, y2 - y1)
End If
Else
If brect = 1 Then
objgraphics.DrawRectangle(tpen, x1 - (x1 - x2), y1 - (y1 - y2), x1 - x2, y1 - y2)
End If
If bellipse = 1 Then
objgraphics.DrawEllipse(tpen, x1 - (x1 - x2), y1 - (y1 - y2), x1 - x2, y1 - y2)
End If
End If
End If
End If
bm.Save("C:\Documents and Settings\manojji\My Documents\My Pictures\temp" & ".bmp")
End Sub
Vineet Swami
Isol
|
|
|
|
|
First, objGraphics isn't defined anywhere in the code you've posted. Next, what is bm and where is it defined??
|
|
|
|
|
objGraphics is defined in a module publicly as
Public objgraphics As Graphics = Frmpage.PicBox.CreateGraphics()
bm is a bitmap object defined as
Dim bm As Bitmap
Private Sub Frmpage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
bm = PicBox.Image
End Sub
thanks
Vineet Swami
Isol
|
|
|
|
|
This is a bad idea. You should be creating a Graphics object whenever you need it, then use it, and Dispose of it. Don't create one and hang onto it for the life of your application.
Also, setting the bitmap object equal to the PictureBox.Image isn't really buying you anything. The bitmap object should be it's own bitmap, drawn on when the mouse is released, then the PicBox, when not drawing on mouse down, should be drawing the contents of this bitmap.
|
|
|
|
|
hi friend
i using this code for verify copy Data its copy Properly or not .
but it's reads full file at a time so it make load on memory Usage and i think in large amount of data verification its create problem. so there any other process to do this
task Please Help me.
Thanks
Code:=
Private Function getFileMd5(ByVal filePath As String) As String
' get all the file contents
Try
Dim File() As Byte = System.IO.File.ReadAllBytes(filePath)
' create a new md5 object
Dim Md5 As New Security.Cryptography.MD5CryptoServiceProvider()
Dim byteHash() As Byte = Md5.ComputeHash(File)
Return Convert.ToBase64String(byteHash)
Catch ex As Exception
End Try
End Function
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
You'll have to change this code to get rid of the line that says ReadAllBytes(filePath) to open the file as a FileStream. Then you can pass the FileStream to the ComputeHash method to compute the hash.
|
|
|
|
|
ok this is the situation
im developing a programs that needs a users to map their database table to another table
but i want it to be visual to minimize the errors that the users can create
can somebody give me an idea on how to do this ?
here is a screenshot of a similar interface i got from another software..
http://i111.photobucket.com/albums/n159/jeipiyaku/dtmap.jpg
can anyone give me an idea on how to this or atleast tell me of a control that i can use to do this
thanks a lot codeproject
|
|
|
|
|
There is no easy way to do this, despite sending in a snapshot of what looks like a sql server database diagram (or maybe Access?)
The only way is to write it yourself, trying to ensure data type integrity.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I want the old DTS field mapping tool, 2 listboxes and draw lines to map the fields.
I must say I'm surprised there is not a custom or third party tool for this.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
yeah to think that i wasted my time looking for one..
and yeah thats what im using now 2 listbox..
and im thinking of creating a control for this
|
|
|
|
|
As Bob said, maintaining data type integrity is going to be a challenge
Whenever we work with ETL we only use VARCHAR and then build a proc to do the transforms only AFTER the data has been loaded into a staging table. One of the reasons I have Biz Talk and SSIS is they try to do the transforms during the load process. I find this hugely complicates the load process.
BTW we do not attempt to supply a "flexible" or generic solution to the users, each type of load requires a specific stored proc to do the transforms. Some of the rules are so complex, based on esoteric data that they cannot be supported by an ETL tool.
We actually paid from a POC for a Biz Talk organsation, we got back a custom process in C#. Turned out a proc in SQL was orders of magnitude faster!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hi all,
i m trying to create shape Viewer using vb.net. i Search on google and Codeproject for find shpae file sample. but fail
can anybody tell me that from which location i can Download sample shape file? so i can test.
i want to following shape type
1. PointM
2. MultipointM
3. PolylineM
4. PolygonM
Please provide some link from which i can download free sample .shp file
|
|
|
|
|
Are you talking about ESRI Shapefiles? If so, you may want to start here[^].
|
|
|
|
|
hi
I am copying file from USB to my hard drive using vb.net
now after copying i want to verify if copied file is same or not.Is there any way to verify it. or is there any way to generate HASH key of a file in order to verify it. As hash key is unique for every file.
Thanks In Advance.
|
|
|
|
|
sumit7034 wrote: now after copying i want to verify if copied file is same or not.
Read the files and compare the data.
sumit7034 wrote: or is there any way to generate HASH key of a file in order to verify it.
Read the files, create an MD5 hash code from the data, and compare the hash codes. If you are only comparing two files, you don't gain anything, though.
sumit7034 wrote: As hash key is unique for every file.
That is not true, as there is a limited number of hash keys. However, two files that are mostly identical are very unlikely to have the same hash key.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Can u give me sample code how to compare.
Thanks
|
|
|
|
|
Private Function getFileMd5(ByVal filePath As String) As String
' get all the file contents
Try
Dim File() As Byte = System.IO.File.ReadAllBytes(filePath)
' create a new md5 object
Dim Md5 As New Security.Cryptography.MD5CryptoServiceProvider()
Dim byteHash() As Byte = Md5.ComputeHash(File)
Return Convert.ToBase64String(byteHash)
Catch ex As Exception
End Try
End Function
Some Time u Try ur Self
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
|
sumit7034 wrote: Can u give me sample code how to compare.
I could, but I would just be pasting code from examples that already exist.
What is it with the code that you have problems with?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hello All
I had connected ftp using vb6.0 application and want to create new folder on ftp using vb6.0.
Please help.
Thanx regards
Shazz
Shazz here to help you...
|
|
|
|