Hi
I was wondering if any of you clever people can help me.
I am writing a app and I have a treeview. This treeview gets populated with parent and children.
I also have a panel and a picturebox with a image in the picturebox.
On top of the picturebox I and writing some Graphical objects.
see code
Dim theG As Graphics = Graphics.FromImage(PictureBox1.Image)
Dim ComputerName As String = ""
Dim UserName As String = ""
Dim NodeIP As String = ""
Dim sqlSearch As SqlCommand = sqlconn.CreateCommand
Dim sqlsubitemSearch As SqlCommand = sqlconn.CreateCommand
sqlSearch.CommandText = "select ******** to make it shorter"
Dim sqlDR As SqlDataReader = sqlSearch.ExecuteReader
While sqlDR.Read
'do stuff with your returned data
ComputerName = (sqlDR.Item("NODE_NAME").ToString)
UserName = (sqlDR.Item("INFO_VALUE").ToString)
NodeIP = sqlDR.Item("Node_IP").ToString
End While
sqlDR.Close()
theG.PageUnit = GraphicsUnit.Millimeter
Dim aFont As New Font("Arial", 10, FontStyle.Regular)
theG.DrawString(ComputerName, aFont, Brushes.Black, 150, 56)
theG.DrawString(UserName, aFont, Brushes.Black, 150, 63)
theG.DrawString(ComputerName, aFont, Brushes.Black, 150, 69)
theG.DrawString(NodeIP, aFont, Brushes.Black, 150, 75)
When Afterselect on the treeview item this code runs.
However when I select another child/node the code runs again whcih is great it write over the top on the previous text.
What is the command or how do I clear/delete/remove the theG.drawStrings from the first AfterSelect from the treeview so the new drwstrings are clear.
I hope this makes some sense.
thanks
Alan
I was wondering if any of you clever people can help me.
I am writing a app and I have a treeview. This treeview gets populated with parent and children.
I also have a panel and a picturebox with a image in the picturebox.
On top of the picturebox I and writing some Graphical objects.
see code
Dim theG As Graphics = Graphics.FromImage(PictureBox1.Image)
Dim ComputerName As String = ""
Dim UserName As String = ""
Dim NodeIP As String = ""
Dim sqlSearch As SqlCommand = sqlconn.CreateCommand
Dim sqlsubitemSearch As SqlCommand = sqlconn.CreateCommand
sqlSearch.CommandText = "select ******** to make it shorter"
Dim sqlDR As SqlDataReader = sqlSearch.ExecuteReader
While sqlDR.Read
'do stuff with your returned data
ComputerName = (sqlDR.Item("NODE_NAME").ToString)
UserName = (sqlDR.Item("INFO_VALUE").ToString)
NodeIP = sqlDR.Item("Node_IP").ToString
End While
sqlDR.Close()
theG.PageUnit = GraphicsUnit.Millimeter
Dim aFont As New Font("Arial", 10, FontStyle.Regular)
theG.DrawString(ComputerName, aFont, Brushes.Black, 150, 56)
theG.DrawString(UserName, aFont, Brushes.Black, 150, 63)
theG.DrawString(ComputerName, aFont, Brushes.Black, 150, 69)
theG.DrawString(NodeIP, aFont, Brushes.Black, 150, 75)
When Afterselect on the treeview item this code runs.
However when I select another child/node the code runs again whcih is great it write over the top on the previous text.
What is the command or how do I clear/delete/remove the theG.drawStrings from the first AfterSelect from the treeview so the new drwstrings are clear.
I hope this makes some sense.
thanks
Alan