Save Selected Index Position?
Jan 18, 2010
So say I have a listbox, and a treeview. I select(using multiselectextended) a bunch of items in the listbox, I then press a button and it sends those selected items to a teeview node and removed them from the listbox... I then modify the items, add more items, etc..after I'm done modifying them, how could I send the items from the treeview back to theyre original position in the listbox?
View 2 Replies
ADVERTISEMENT
May 13, 2010
I have a very large number of tables with data in the following format:
A X Y Z
1 0-2 0-13 0-1
2 3-5 14 2-4
3 6-9 15-16 5-10
In other words, there is a variable (call it A) with a single value that corresponds to a range of values in the other variables (call them X, Y, and Z).My program needs to accept user text input of values of X, Y, Z, etc. and then match each to the corresponding value of A.Example: User enters 4 in the X text box; program determines that if X=4, A=2.Again, we're talking about tables and tables of data in this format. Unaware of a better method, I have been using arrays.
Example:
Dim a() as double = {1,1,1,2,2,2,3,3,3,3...}
Dim x() as double = {0,1,2,3,4,5,6,7,8,9,10...}
Note how I had to artificially deal with variable A so that the index of each score corresponds to the index of the matching X variable.It is this modification of the variables that is taking forever. There has to be a better way! Hypothetically, what I need is the ability to do something like this:
Dim a() as double = {1,2,3,4...}
dim x() as double = {0 to 2, 3 to 5, 6 to 9...}
Is there a way to represent a range of values at a single index of an array, such as my hypothetical example above? This would save me hours of re-shaping the data to make the arrays work.
View 6 Replies
May 7, 2009
I'm looking for the actual index position in a given source string.I have the following string
"<a>
<b>zyx</b>
<b>wvu</b>
[code]....
I'm loading that string into a .NET XmlDocument object. Carriage Returns and Line Fees may be a factor here.
Dim xmlSearchText As New XmlDocument()
xmlSearchText.LoadXml(SearchTextBox.Text)
Dim selectedNode As XmlNode = xmlSearchText.SelectSingleNode(txtSearch.Text)
The following XPath Statement could be used to find the 3rd node:
a/b[.='tsr']
However, I need it to return a string index of 23 rather than the ordinal position of 3.
View 2 Replies
Jul 5, 2011
I'm creating a BASIC application, and I can't figure out how to save a user selected file (FolderBrowserDialog) to a location selected in another dialog (SaveFileDialog).
View 5 Replies
Apr 8, 2011
If i try
ListView1.Sorting = SortOrder.None
ListView1.ListViewItemSorter = Nothing
ListView1.Items.Insert(0, "0")
ListView1.Items.Insert(1, "1")
ListView1.Items.Insert(0, "2")
ListView1.Items.Insert(1, "3")
If ListView1.View is SmallIcon , LargeIcon or Tile it dont work (Display 0 1 2 3). If it's in List it works (Display desired 2 3 0 1).
View 1 Replies
Nov 22, 2011
I have a text box and button inside a panel , and I want to show this panel right next to gridview selected row , gridview is also inside another panel , is there anyway to find out selected rows position ? This is a asp. Net page and I am using vb.net . Panel can be replaced by div
View 2 Replies
Oct 17, 2009
I'm trying to make it so the the images will save to the folder that you selected in the textbox1.text from the folderbrowser this is the code's I have tried
[Code]...
View 1 Replies
Jan 31, 2012
I want to know How to get The last selected Index in the multi select of ListView.For example, when i select Item from index 1 to 10, so I get index 10 as the last selected index.But if i select Item from 10 to 1, so I get index 1 as the last selected index.
View 5 Replies
May 3, 2011
how to get the selected index from a listview i know you can do the "ListView.SelectedIndices.Item(0)" but then you still need to know the index of the selected item.
View 14 Replies
Dec 9, 2010
'Get the selected index of the list box 'use that selectedindex for the row of the array and get both the quantity and price into local variables in VB
[Code]...
View 6 Replies
Oct 19, 2011
Can any one tell me how can i get the current selected indel in the ListView.
I need to execute a code every time the selection changes in ListView.
I have listView with only one column. All the list will be in column 0.
I used the below code in Listview1_Click event and able to get the selected index value,but when i used the same code in the Listview1_SelectedIndexChanged and Listview1_ItemSelectionChanged its giving below below error Private Sub ListView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.Click
[Code]...
View 2 Replies
Dec 6, 2011
I think I'm having a brain fart on this but I can't seem to figure out why this is not working.
Public Class Radio_Main
Dim RadioDial As String = 1
Dim Go As String = "http://"
Private Sub pb_Tuner_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pb_Tuner.Click
'My.Computer.Audio.Stop()
[Code]...
View 2 Replies
Jul 22, 2009
I drag Tabcontrol.& add two tab pages. I have contextmenu Strip, dat i bound to tabcontrol.I select the ContextMenuStrip & set it to ContextMenuStrip1
Now i right click on tab headers.Suppose i right click on tabpage1,contextmenu is displayed.I want that when i right click on tabpage..I want to get the index of that tab..Even if dat tab page is selected.[code...]
View 2 Replies
Jul 24, 2009
I drag Tabcontrol.& add two tab pages.I have contextmenu Strip, dat i bound to tabcontrol.I select the ContextMenuStrip & set it to ContextMenuStrip1Now i right click on tab headers.Suppose i right click on tabpage1,contextmenu is displayed.I want that when i right click on tabpage..I want to get the index of that tab..Even if dat tab page is selected.Ex-Mozilla.
Private Sub TabControl1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TabControl1.MouseClick
Try
[code]....
Above event gives me the index,when i select the tab.
View 2 Replies
May 5, 2011
I want to place the selected item from a listbox at the top (or second) position in the listbox display.I can't find a stylebit for this.
View 3 Replies
May 5, 2009
The first would be, how would I go about making each index in a list box an integer or decimal value? For example, If I wanted the 1st (or 0) index to = 300 and the next one (1) = 400. The next question that I have is that, if I had two or more list boxes with each index as a certain value as listed above, how would I go about adding up the total for each index that is selected?
View 10 Replies
Jul 18, 2010
I need a way of converting the listbox.selectedindex into hex and then writing it to a file(The writing is done using PackageIO.writer). The weird thing is the code i use works for most of it but on some of the writes and conversions it just converts the selectedindex to 00 when its not.
Dim Writer As New PackageIO.Writer(Filepath, Endian.Little)
Writer.Position = &HE24A
Writer.WriteUInt16(Convert.ToByte(ListBox3.SelectedIndex))
[code]....
View 25 Replies
May 15, 2010
I have a DataGridView containing a large number of columns. I want the users to be able to select multiple columns and then select a menu item to hide the selected columns. For example a user might selected columns 5 through 10 and I want the program to hide those columns. I know how to hide columns, one at a time. I can get the count of selected columns but I have not figured out how to get the index to the left-most selected column. Trial and error is such a slow process.
Considering the huge number of options offered by the DataGridView tool, it would be nice if this forum had a special category for the DataGridView (common to VB and C#).
Finally I got the desired results but it took a lot of coding, looping through the selected cells to find the one with the lowest column index, then a second loop to count previously-hidden columns, then a third loop for hiding the selected columns, stepping past previously-hidden columns and declining to hide frozen columns.
View 7 Replies
Oct 10, 2011
I have loaded datatable to listview.Now when i try to do a selected index and retrieve data to display in respective text box. I find some error "input string format incorrect".but when i directly load from folder it works fine.
Data that retrieved from Datatable.Im not able to find the index of the row. But from folder and listed in ListView.Index value is found.
Dim breakfast As ListView.SelectedListViewItemCollection = Me.LOV.SelectedItems
For Each item1 In breakfast
index += Double.Parse(item1.SubItems(1).Text)
Next
View 2 Replies
Jun 22, 2010
how can i get the index of selected row in listview in mouse up?
View 2 Replies
Jul 10, 2009
listview of 8 columns and 13 rows... on selection, my mouse is over item row 10 column 6, how will i be able to get the index of that sub item??? so far no sample codes available over the net yet...
< lsv1.SelectedItems.Item(0).Index > only works showing index of the main item in a row... i.e. will display row 10, col 0 index only even if my mouse is over item row 10 column 6 upon selection...
View 10 Replies
Apr 13, 2012
the following is the my code:
Private Sub cboYear_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles cboYear.SelectedIndexChanged
'declare variables
Dim intSelectedYear As Integer
[code]....
View 2 Replies
Jul 3, 2009
ListView Properties- I set MultiSelect to False, LabelEdit to true,FullRowSelect to True. I have Listview with two columns.
1) When I select onw row in listview,On button click i want to get the index of selected row. I m getting it but using for loop,I want to know is there a way to know the index of selected row,Without using the for loop.
[Code]....
View 4 Replies
Jul 22, 2009
I drag Tabcontrol.& add two tab pages. I have contextmenu Strip, dat i bound to tabcontrol.I select the ContextMenuStrip & set it to ContextMenuStrip1 Now i right click on tab headers.Suppose i right click on tabpage1,contextmenu is displayed.I want that when i right click on tabpage..I want to get the index of that tab..Even if dat tab page is selected.
[Code]...
View 2 Replies
Mar 3, 2010
I've been working with a listview. I just need to know how to get the index of the selectedindex otherwise I can't work anything out, if the application doesn't know what is selected... I tried these codes but none tells me the index, I am just lost with it, thought shouldn't be that hard...
Dim index As Integer
Dim item As ListViewItem
lsvOrderDetails.SelectedItems.IndexOf
item = lsvOrderDetails.SelectedItems.Item()
index = item.Index
View 2 Replies
May 16, 2010
im having a problem regard combobox selected index.the combobox wont change its index when i type a text that is the same with one of the items and pressing tab. when i check its selected index its -1. ill give an example to make it simple..combobox items = AB, AC, AD i entered "AB" by simply typing it not by selecting in the dropdown.its index is -1, how can i make the index the same with the items in the drop down?
View 2 Replies
Feb 4, 2010
I execute some code for current on binding source when selectedIndexChanged.Problem is it throws an error when its executed on closing the form. I can wrap in a try catch... but what would the proper way to handle this be?
Select Case TabControl_Lanes.SelectedTab.Name
Case tp_create_Lanes.Name
depotName = CStr(M8DepotsBindingSource.Current("depotName"))
depotID = CInt(M8DepotsBindingSource.Current("depotID"))
End Select
View 2 Replies
Jul 1, 2009
Here is my code for programming a program that reads from a file called RESORT.TXT
Containing the text:
Barb Allen
604 777 1234
[code].....
View 7 Replies
Aug 21, 2010
I am using vb 2008, DataBound Controls and typed dataset. My form is having Group Box (initially hidden) and some text box, combobox controls for Data Entry, and the code is
bsSales.AddNew()
txtCreditDays.Text = 20
dtDueDate.Value = dtSalesDate.Value.AddDays(txtCreditDays.Text)
cboGodown.SelectedIndex = 0 '
Default
gBox.Visible = True
dtSalesDate.Focus()
I have set the combo box to select the 1st record in the list however, when the next Statement that is "gBox.Visible=True" is executed, the Combo Box is again set to -1 position. Why is it?
View 2 Replies
May 19, 2012
I need to develop a function called SetComboBox that accepts the category(ies) in the ComboBox as a string and returns an integer indicating the index position of the category in the ComboBox. The function is supposed to set the category in the ComboBox Selected Index property to match the string category stored in a database for an inventory item.
View 1 Replies