Click here to Skip to main content
16,004,944 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: get value from databound combobox into string Pin
oakleaf6-Jul-05 9:05
oakleaf6-Jul-05 9:05 
GeneralRe: get value from databound combobox into string Pin
Anonymous6-Jul-05 9:31
Anonymous6-Jul-05 9:31 
GeneralRe: get value from databound combobox into string Pin
oakleaf6-Jul-05 10:05
oakleaf6-Jul-05 10:05 
GeneralStrange Behavior in WinForm Pin
Mtognetti6-Jul-05 8:27
Mtognetti6-Jul-05 8:27 
Generalcommunicating with c++ using sockets Pin
boy2126-Jul-05 7:57
boy2126-Jul-05 7:57 
GeneralRe: communicating with c++ using sockets Pin
Dave Kreskowiak6-Jul-05 8:16
mveDave Kreskowiak6-Jul-05 8:16 
GeneralFilelistbox Pin
JimClark686-Jul-05 7:41
JimClark686-Jul-05 7:41 
GeneralRe: Filelistbox Pin
Anonymous6-Jul-05 9:15
Anonymous6-Jul-05 9:15 
I'm not sure what your FileListBox contains, but I will assume it contains the specified path of the file? If so, you can try the following:

Private Sub btnMove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMove.Click, btnCopy.Click<br />
   <br />
Dim btnClicked as Button<br />
'assuming selected item is String <br />
'for the full path of an existing file<br />
Dim f as New FileInfo(FileListBox.SelectedItem.ToString)<br />
<br />
btnClicked = CType(sender, Button)<br />
<br />
'Move or Copy according to clicked button<br />
Select Case btnClick.Name<br />
   Case "btnMove"<br />
'Move to destination directory - f.Name indicates the original file name<br />
     f.MoveTo("destDir\" + f.Name)<br />
'OR<br />
'File.Move(sourceFileName, destFileName)<br />
   Case "btnCopy"<br />
     f.CopyTo("destDir\" + f.Name)<br />
'OR<br />
'File.Copy(sourceFileName, destFileName)<br />
End Select<br />
End Sub

GeneralRe: Filelistbox Pin
JimClark686-Jul-05 9:36
JimClark686-Jul-05 9:36 
GeneralRe: Filelistbox Pin
Anonymous6-Jul-05 9:48
Anonymous6-Jul-05 9:48 
GeneralRe: Filelistbox Pin
Anonymous6-Jul-05 9:52
Anonymous6-Jul-05 9:52 
GeneralRe: Filelistbox Pin
Anonymous6-Jul-05 9:54
Anonymous6-Jul-05 9:54 
GeneralRe: Filelistbox Pin
JimClark687-Jul-05 4:08
JimClark687-Jul-05 4:08 
GeneralRe: Filelistbox Pin
JimClark687-Jul-05 4:03
JimClark687-Jul-05 4:03 
GeneralRe: Filelistbox Pin
Anonymous7-Jul-05 4:43
Anonymous7-Jul-05 4:43 
GeneralRe: Filelistbox Pin
JimClark687-Jul-05 7:35
JimClark687-Jul-05 7:35 
GeneralRe: Filelistbox Pin
JimClark687-Jul-05 9:48
JimClark687-Jul-05 9:48 
GeneralRe: Filelistbox Pin
Anonymous7-Jul-05 10:09
Anonymous7-Jul-05 10:09 
Generalkeys is not working in datagrid Pin
Jeeva Jose6-Jul-05 6:25
Jeeva Jose6-Jul-05 6:25 
QuestionIgnoring Type mismatch? Pin
brokenchode6-Jul-05 5:28
brokenchode6-Jul-05 5:28 
Questionlinked combo boxes? Pin
oakleaf6-Jul-05 3:34
oakleaf6-Jul-05 3:34 
AnswerRe: linked combo boxes? Pin
Anonymous6-Jul-05 4:20
Anonymous6-Jul-05 4:20 
AnswerRe: linked combo boxes? Pin
Anonymous6-Jul-05 4:25
Anonymous6-Jul-05 4:25 
GeneralRe: linked combo boxes? Pin
oakleaf6-Jul-05 4:42
oakleaf6-Jul-05 4:42 
Questionhow to populate my form with data? Pin
mian rashed6-Jul-05 1:12
mian rashed6-Jul-05 1:12 

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.