|
-
Sep 1st, 2006, 06:35 AM
#1
Thread Starter
New Member
Listbox Help [2005]
Hi,
I have made an application which does some mathematical calculations which are linked to the Newton-Raphson process and the results are displayed in a listbox.
Often there are lots of results, and whereas all of them have to be displayed, I only want to look at the last couple, so is there an easy way to make the listbox containing the results scroll down right to the bottom to the last entry, and how can i easily copy items from the list box (using some type of ctrl + c)?
Thanks
Augustus_Caesar
-
Sep 1st, 2006, 07:08 AM
#2
Re: Listbox Help [2005]
VB Code:
ListBox1.SelectedIndex = ListBox1.Items.Count - 1
will scroll (and select) your listbox to the last item in the list
-
Sep 1st, 2006, 07:56 AM
#3
Lively Member
Re: Listbox Help [2005]
To copy the selection in a listbox you can use this:
VB Code:
Private Sub listbox1_Keypress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles listbox1.KeyDown
If e.Control Then
If e.KeyCode = Keys.C Then
MsgBox("You can now do what you want with this:" & listbox1.selecteditem)
End If
End If
End Sub
-
Sep 1st, 2006, 07:59 AM
#4
Lively Member
Re: Listbox Help [2005]
hi what code do you use to send the string/selected item to the clipboard?
-
Sep 1st, 2006, 08:01 AM
#5
Re: Listbox Help [2005]
VB Code:
Clipboard.SetText(ListBox1.SelectedItem)
-
Sep 1st, 2006, 08:05 AM
#6
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|