|
I have problem with the code below.
Add(String, System.Drawing.Image, System.EventHandler)
I don't know how to replace System.EventHandeler
Thanks
................
|
|
|
|
|
Are you trying to modify the add button on the toolstrip?
Nathan Lindley
.NET Aficionado
|
|
|
|
|
Here is an example:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.ToolStrip1.Items.Add("test", Nothing, AddressOf ButtonClickedEventHandler)
End Sub
Public Shared Sub ButtonClickedEventHandler(ByVal sender As Object, ByVal e As System.EventArgs)
MessageBox.Show("This is a test.")
End Sub
Mike Lasseter
|
|
|
|
|
What the problem if I want to get text from the name that i added to display in message box
Thanks
-- modified at 22:30 Saturday 7th October, 2006
................
|
|
|
|
|
I would like to know if there is a way to populate the combo box in VB 6 using data from a certain table's field. for example i have a form that holds employee details but i also want to pick department code from another table how do i go about it?
|
|
|
|
|
The easiest way is to make sure that you join both tables in your SQL statement, so you can loop through the records returned and fill it right away.
Otherwise, you have to loop through the parent records, and find the value of the department code (by looping) in the other records.
"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin
Edbert
Sydney, Australia
|
|
|
|
|
HI
i have an image stored with only solid colors
i want to know color percentage of each color in the image
can u help me how to do it
piyush
|
|
|
|
|
YOu can look at my image processing articles for how to read the pixels of an image directly. VB.NET cannot do this, you'd have to do it in C#. The (slow) alternative is to use the GetPixel method. Then you can either work out the shapes that are the same color, or count colors, depending on how complex the shapes are.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I've got what should be an easy question, but I can't find the correct combination in VB.NET.
I have a drop down list of numbers in a combo box. When I leave the form, I want to know which number was chosen.
NumSamp.SelectedIndex()
tells me which index I've chosen, but I can't get the integer or text value of the entry.
NumSamp.SelectedText() or NumSamp.SelectedValue() both come back as nothing.
There must be an easy way to get the value of the chosen entry, but I can't seem to find it.
Thanks,
Ilan
|
|
|
|
|
why can't you use
Request.form("id of combobox").value
it returns index of number selected by user when he leaves the form
use
document.all("idofcombobox").value in javascript for same value without post back form
|
|
|
|
|
Visual Basic doesn't understand "Request" and since I've never used it, neither do I.
While I'm still in the form, I have the combo box. It is called NumSamp.
It seems to me that I ought to be able to query NumSamp in some easy way to find out which value in a list of values was chosen.
In fact, NumSamp.SelectedIndex() gives me the correct offset in the list of values. I'm just missing the next step: given the index, what is the value of the entry?
Thanks,
Ilan
|
|
|
|
|
NumSamp.SelectedIndex.value
will solve your problem
|
|
|
|
|
Thanks for your kind answer.
|
|
|
|
|
Use NumSamp.SelectedItem . If you're coding with Option Strict On use the .ToString() method as well.
Sample
Private Sub Button1_Click(...) Handles Button1.Click
'pass value of selected item to Form2
Dim frm2 As New Form2
frm2.Text = Me.ComboBox1.SelectedItem.ToString
frm2.Show()
End Sub
|
|
|
|
|
Thanks,
It was under my nose all the time and somehow I missed it.
As I expected, it is really easy.
|
|
|
|
|
Let say i have the data below in a textfile call testing.txt
No,Title
1,Information
2,Error message
3,Question
Now, how can i specify,get and display the second line data?
I would appreciate so much for help!!
|
|
|
|
|
If it's the second line, you can read a line at a time and use the second one. Or you can use a regex to parse the data.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for help, but can i have sample coding?
|
|
|
|
|
System.IO.File.ReadXXX is the group of methods that are the easiest way to read a file into a string or group of strings.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Sorry for the troublesome! This is some of my code which i only manage to get title as return. May i have some advice on it?
Private Function ReadTextFile(ByVal sFileName As String) As String
Dim s As String = String.Empty
Try
Dim oFile As FileStream = New FileStream(sFileName, FileMode.Open, FileAccess.Read, FileShare.Read)
Dim oReader As StreamReader = New StreamReader(oFile)
s = oReader.ReadLine()
oReader.Close()
oFile.Close()
ReadTextFile = s
Catch
ReadTextFile = "Unable to open file."
End Try
End Function
|
|
|
|
|
Your problem is that you're only reading the first line of the file.
The ReadLine call needs to be a recurrent call, based on the return value of the method.
e.g. (from MSDN)
<br />
Dim input As String<br />
input = sr.ReadLine()<br />
While Not input Is Nothing<br />
'Do something with the input<br />
<br />
'Read the next line of input<br />
input = sr.ReadLine()<br />
End While<br />
This will continue to read the file until there is no further input returned by the ReadLine() call. Then you'll have to compare the returned input string to whatever you want to catch, either using a regex or a string constant (in the case of a marker string or something that won't change) to get the particular peice of info you're after. I would add do it something like this...
<br />
Dim input As String<br />
input = sr.ReadLine()<br />
While Not input Is Nothing<br />
<br />
If (input.CompareTo(stringConstant) = 0)<br />
'do whatever with the data<br />
input = Nothing<br />
Else<br />
input = sr.ReadLine() <br />
End If<br />
End While<br />
|
|
|
|
|
Thank u, it really help a lot!
|
|
|
|
|
Hi all,
I have created application for uploading huge chunk file (min 1gb) to server(CONTENT MGMT SERVER).
File Size TIME
1.4 GB 22 Minutes
3.17 GB 32 Minutes
I am reading 10MB chunks for each partial write and utilizing maximum of 25 threads running at any point of time during execution. Can anyone help me to improve performance application.
I would appreciate, If anyone give me suggestion to improve performance of application.
Thanks,
Vijay Kumar
Email#jaydotnet@gmail.com
vijay
|
|
|
|
|
jaydotnet wrote: Can anyone help me to improve performance application.
Upgrade to an OC48 line? Warning! Can be cut by any idiot with a backhoe.
jaydotnet wrote: 10MB chunks for each partial write and utilizing maximum of 25 threads
25 threads? For what?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Dave,
I appreciate your reply.
I am using window application for uploading this huge data to content management server. when i try to transfer 1 huge chunk data (more than 1 gb) it take more than 1 hr to transfer. content mgmt server reads data byt 16kb and buffers in internal memory then writes to server. content management server group suggested us to read file into multiple slice and upload file using multi-threading(max 25 at any time). After doing this we had some performance improvement but no upto expectation.
if you need i can post my code.
thanks
Vijay
|
|
|
|