Click here to Skip to main content
15,919,931 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Excel to oledb dataset Pin
ChandraRam2-Jan-08 23:51
ChandraRam2-Jan-08 23:51 
GeneralRe: Excel to oledb dataset Pin
Daakuryu3-Jan-08 15:02
Daakuryu3-Jan-08 15:02 
GeneralRe: Excel to oledb dataset Pin
ChandraRam3-Jan-08 19:49
ChandraRam3-Jan-08 19:49 
GeneralRe: Excel to oledb dataset Pin
Daakuryu7-Jan-08 15:33
Daakuryu7-Jan-08 15:33 
GeneralRe: Excel to oledb dataset Pin
ChandraRam7-Jan-08 18:19
ChandraRam7-Jan-08 18:19 
GeneralRemoving empty elements in array Pin
ExcelMonkey2-Jan-08 12:35
ExcelMonkey2-Jan-08 12:35 
AnswerRe: Removing empty elements in array Pin
Guffa2-Jan-08 21:22
Guffa2-Jan-08 21:22 
GeneralTransfering Items between 2 Listviews Pin
ExcelMonkey2-Jan-08 9:29
ExcelMonkey2-Jan-08 9:29 
I have a form with an imagecontrol (2 icons) and 2 listviews. I have loaded file names and icons into the first listview control. I have set the tag property of the item in the first listview to the directory path of the file.

I need to allow the user to pick the files he/she wants from the first listview and add them to the second listview via a button. When I use the code below the icon does not appear. Furthermore I have to use the .Text property of the NewItem variable in order to add it to the second listview. My goal here is to be able to add the item to the second listview and I also need to add the tag property of the item in focus from the first lisview to the tag property of the item in the second listview.


Once the files have all been added to the second listview I load them into an array via another button. I am noticing that as I loop through the items in the secondlistview that although the variable X shows the files, both the name and tag properties are "".

Is this because I used the .TEXT property as stated above? How do I work around this?

Private Sub Button10_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
Dim NewItem As ListViewItem
NewItem = listView1.FocusedItem
NewItem.ImageIndex = 2
listView2.Items.Add(NewItem.Text)
NewItem.Tag = listView1.FocusedItem.Tag 'Transfer Tag of item in listview1 to item in listview2
listView2.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize)
End Sub

"***************************************************************************************
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

'Load selected files into array
Dim Y As Integer
Dim X As ListViewItem

Dim Counter As Double
Y = listView2.Items.Count

ReDim FileArray(Y-1, 1)

Counter = 0
For Each X In listView2.Items
FileArray(Counter, 0) = X.Name
FileArray(Counter, 1) = X.Tag
Counter = Counter + 1
Next
End Sub
GeneralRe: Transfering Items between 2 Listviews Pin
Dave Kreskowiak2-Jan-08 10:39
mveDave Kreskowiak2-Jan-08 10:39 
Generalrecord like in pascal Pin
vykintasv2-Jan-08 8:47
vykintasv2-Jan-08 8:47 
GeneralRe: record like in pascal Pin
Dave Kreskowiak2-Jan-08 9:17
mveDave Kreskowiak2-Jan-08 9:17 
GeneralRe: record like in pascal Pin
vykintasv2-Jan-08 11:18
vykintasv2-Jan-08 11:18 
GeneralRe: record like in pascal Pin
Colin Angus Mackay2-Jan-08 12:41
Colin Angus Mackay2-Jan-08 12:41 
GeneralMy SQl adapter is not behaving normal Pin
Vimalsoft(Pty) Ltd2-Jan-08 3:18
professionalVimalsoft(Pty) Ltd2-Jan-08 3:18 
GeneralRe: My SQl adapter is not behaving normal Pin
Dave Kreskowiak2-Jan-08 5:16
mveDave Kreskowiak2-Jan-08 5:16 
GeneralRe: My SQl adapter is not behaving normal Pin
Vimalsoft(Pty) Ltd2-Jan-08 7:11
professionalVimalsoft(Pty) Ltd2-Jan-08 7:11 
GeneralRe: My SQl adapter is not behaving normal Pin
Dave Kreskowiak2-Jan-08 7:34
mveDave Kreskowiak2-Jan-08 7:34 
GeneralRe: My SQl adapter is not behaving normal Pin
Vimalsoft(Pty) Ltd2-Jan-08 9:11
professionalVimalsoft(Pty) Ltd2-Jan-08 9:11 
GeneralRe: My SQl adapter is not behaving normal Pin
Dave Kreskowiak2-Jan-08 9:32
mveDave Kreskowiak2-Jan-08 9:32 
GeneralRe: My SQl adapter is not behaving normal Pin
Vimalsoft(Pty) Ltd3-Jan-08 5:13
professionalVimalsoft(Pty) Ltd3-Jan-08 5:13 
GeneralVB.NET Multithreading question [modified] Pin
SimulationofSai2-Jan-08 0:49
SimulationofSai2-Jan-08 0:49 
GeneralRe: VB.NET Multithreading question Pin
Dave Kreskowiak2-Jan-08 7:44
mveDave Kreskowiak2-Jan-08 7:44 
GeneralRe: VB.NET Multithreading question Pin
SimulationofSai2-Jan-08 18:28
SimulationofSai2-Jan-08 18:28 
GeneralRe: VB.NET Multithreading question Pin
Dave Kreskowiak3-Jan-08 6:56
mveDave Kreskowiak3-Jan-08 6:56 
Generalslow performance on 1st add new row to datatable Pin
Eunice (VB junior)1-Jan-08 22:32
Eunice (VB junior)1-Jan-08 22:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.