|
I am trying to do a barchart from data in a csv file in vb 2k3. I can write the required data to the csv file, but from here i am totally stuck and don't know which way to turn.
Any help or advise would be greatfully welcome.
Regards
Zeldacat
|
|
|
|
|
You need to either write code to draw a chart, or use a commercial or free library that does it for you.
If you want to write it yourself, read up on the Graphics and Bitmap classes.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
http://www.zedgraph.org[^]
If you can read the csv file in yourself (and honestly, that should be trivial), ZedGraph has some awesome charting capabilities, including bar charts.
The early bird who catches the worm works for someone who comes in late and owns the worm farm. -- Travis McGee
|
|
|
|
|
Hi,
Can anyone tell me the solution to this problem. I have built a procidure wrapped in a class that takes a parameter.This procidure is called normally by starting a thread. When an event occures, it is required to call the procidure with new paramater.
A code snippet would be like this.
Private Sub btnReceive_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReceive.Click
remote = New RemoteConnection 'this is the class
trListen1 = New Thread(AddressOf remote.ReceiveMessage)
remote.msg = "Message has been received."
trListen1.Start()
End Sub
Private Sub btnChange_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChange.Click
If trListen1.IsAlive = True Then
trListen1.Abort()
Else
remote = New RemoteConnection
trListen2 = New Thread(AddressOf remote.ReceiveMessage)
remote.msg = "Message has been received,answer is here."
trListen2.Start()
End If
End Sub
But this does not work. How this can be handled?
Thanks.
reman
|
|
|
|
|
Hi Reman,
What you are trying to do is reasonably clear, however...
Amer Rehman wrote: But this does not work.
is not.
How does it not work? Is an error thrown, or what? If so, at what point in this code? etc?
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi!
I'm beginner to VB.net & SQL server. I am doing a project in VB.net 2003 & SQL Server 2000. I don't konw the back up coding. please tell me.
_kalgi_
|
|
|
|
|
How is it that a VB.NET beginner is using SQL Server and trying to write mission critical code for backing up data ?
Which bit are you stuck on ? How much SQL and VB do you know ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If I understand you correctly you are asking how to backup your VB project code.
If I am correct in my assumption then all you need to do is backup the appropriate folder and all its contents within the projects folder.
So if your project is called UseTheForce the path to backup will be something like:
C:\Documents and Settings\HP_Administrator\My Documents\Visual Studio 2005\Projects\UseTheForce
This holds everything relating to your project.
I hope I got the right end of the stick and that this is of help...
You always pass failure on the way to success.
|
|
|
|
|
|
You must use DMO. In this sit you can find source code about DMO
|
|
|
|
|
how can i send a right click event to my application and more over can i get any help how can i simulate double click event in that same application.I want help in VB.net for these events any clue how can i impliment them
farah
|
|
|
|
|
Why do you want to ? Send them from where ? The obvious thing to do is to write a method that is called by your right click event, and call it when ever else you need to.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i just want to code a right click that works the same way as normal right click funtion does that is when i right click on any control in VB.net or over any where else outside my VB.net application it performs the right click function i want to write the code in VB.net but i am new to VB.net environment so i am having problem in coding it and i am also having problem to code double click event too .
farah
|
|
|
|
|
I suspect you need to use p/invoke to simulate right clicks. I don't know that the framework lets you.
Your question the second tme is different to the first time. Also, why are you having problems with the double click event ? What bit is the problem?
farah mazhar wrote: but i am new to VB.net environment
Sounds like a classic case of someone picking up a compiler and trying to use it without learning how first. What are you trying to write that your first VB project needs to simulate right clicks across the entire system ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yes you right i want my right click to work over the whole system through VB.net program
farah
|
|
|
|
|
I know. I was hoping when I saw your reply that you'd actually answered the questions I asked you.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I wish to create the report using the code and to be print out the same report from current form as the current transaction number
thanks
haneefa
|
|
|
|
|
I am trying to read a variable number of bytes from another .Net application but I can't ever get the whole message to read in properly. I have a string with ids and data values (id:value|id:value|...) that I convert to bytes before sending. I keep reading on forums that the standard way of reading a variable number of bytes is to add the number of bytes on the front of the message but I cannot find any examples of how to do that. I can add the length in bytes to the string but then I have to convert that to bytes to transmit so it doesnt seem to help. Am I missing something
Any help would be appreciated - I am on a time crunch
|
|
|
|
|
You said much, but nothing useful to diagnose the problem. We'd have to see the code the you're using to both send and receive the information. TCP?? So you've implemented a socket server and client in your app??
|
|
|
|
|
Here is my code
Sending code
Public Sub Send(ByVal dataToSend As String)
Try
bytesToSend() As Byte = System.Text.ASCIIEncoding.ASCII.GetBytes(dataToSend)
mysocket.Send(bytesToSend,0,bytesToSend.Length)
Catch se as SocketException
MsgBox(se.ToString)
End Try
End Sub
Receiving
Private Class StateClass
Public clientSocket As Socket
Public clientBuffer() As Byte ------> how do i know the buffer size before hand
End Sub
Public Sub OnAcceptConnection(ByVal result as IAsyncResult)
Dim state as New stateClass
Dim serverSocket As Socket = CType(result.AsyncState, Socket)
Try
state.clientSocket = serverSocet.EndAccept(result)
state.clientSocket.BeginReceive(state.clientBuffer,0,state.clientBuffer.Length,SocketFlags.None, _
New AsyncCallback(AddressOf ReceiveCallback,stateClass)
Catch acceptex as Exception
MsgBox(acceptex.ToString)
EndTry
EndSub
Private ReceiveCallback(ByVal result2 as IAsyncResult)
Try
Dim state As stateClass,CType(result2.AyncState,stateClass)
Dim numberBytesRead As Int32 = state.clientSocket.EndReceive(result2)
If numberBytesRead >0 Then
Dim receivedString As String = ASCII.GetString(state.clientBuffer)
Console.WriteLine(receivedString)
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
|
|
|
|
|
captainmogo wrote: Private Class StateClass
Public clientSocket As Socket
Public clientBuffer() As Byte ------> how do i know the buffer size before hand
End Sub
You don't let this size be variable, you set it to a static value, say 4K. You'll have to adjust this size for your own requirements.
Private Class StateClass
Public clientSocket As Socket
Public clientBuffer(4096) As Byte
End Class
|
|
|
|
|
If I set it to, say 4k and the message that I am sending is larger than that - it wont get all of it unless I loop it with .BeginReceive again. I have tried that in the past and still have not gotten it to work properly. The .BeginReceive never fires a second time. I am not sure what I am doing wrong which is why I was hoping there was a good example out there. I have 4 channels each of very different size but only 1 stateclass - so how do i adjust it to fit each channel. Is this even possible.
|
|
|
|
|
captainmogo wrote: it wont get all of it unless I loop it with .BeginReceive again. I have tried that in the past and still have not gotten it to work properly. The .BeginReceive never fires a second time.
This is because you have to setup another Async Begin Read at the end of your ReceiveCallback.
Private Sub ReceiveCallback(yada)
yada, yada, yada
' Convert another chunk of the data to whatever you need...
' Invoke any control update methods you need...
' and last but not least, setup and fire off another BeginRead...
StartAsyncRead()
End Sub
StartAsyncRead is where you create a State object and call the BeginRead method again.
captainmogo wrote: I have 4 channels each of very different size but only 1 stateclass - so how do i adjust it to fit each channel.
The buffer size has to be big enough to hold either an entire message. OR the code breaking down the message into bytes has to fit as much as it can in the buffer and wait for another chance to send the next chunk. OR you leave it a variable size and ReDim the buffer to a known size defore you fill it. OR you could even just create 4 different size State classes.
|
|
|
|
|
Hi, I currently using VB.NET with Rich Text Box control, if focus my cursor wherever, can i get high light background? (example if i focus in column 2 it will high light only column 2).
Socheat
|
|
|
|
|
There's a problem with that. There is no "column 2". The RTB doesn't have columns, just lines, which can span multiple visible rows in the RTB and characters in that line.
For instance, in the RTB, this is one line (if there is no carriage return entered anywhere in the text):
--This is one line. This is one line. This is one
line. This is one line. This is one line. This is
one line. This is one line. This is one line. Thi
s is one line. This is one line. This is one line
. This is one line. This is one line. This is one
line. This is one line. This is one line. This i
s one line. This is one line. This is one line.[ENTER]
Now, your code could go through every line in the RTB and highlight the second character of each line, but in the above example, only one character would get highlighted, the second one on the first row of characters. Line two doesn't begin until after the [ENTER].
|
|
|
|