|
Your first two lines duplicate each other:
Dim items = ListBox1.SelectedItem() // get a list of the SelectedItem(s)
For Each items In ListBox1.SelectedItems // do the same, but duplicating the variable name
But either way they make little sense as you do not do anything with the item you pull from the ListBox.
You need something like:
For Each file As String In ListBox1.SelectedItems
Next
Try not to write all your code inline, as it makes it so much more dificult to read and, more importantly, to debug.
|
|
|
|
|
aaarrggghh...im not able to make it work ...could you be a little more explicit please?
|
|
|
|
|
In what sense more explicit?
You know, one of the most frustrating things in these forums is when people keep saying things like, "it doesn't work". We have no way of knowing what that is supposed to mean, even when we can see your code.
So I suggest you start a new question. Make sure you post the code that you are using, and explain, in proper and complete detail what is not working, and why that is so.
|
|
|
|
|
could you correct my code?
Dim items = ListBox1.SelectedItems()
For Each items In ListBox1.SelectedItems()
If CheckBox1.Checked = True Then
myMp3.ID3v2Tag.Title = TextBox1.Text
myMp3.Write()
End If
Next
Next
|
|
|
|
|
Unless you know "why" you want to convert a string to "byte" (which makes little sense in your present context) even knowing "how", will only get you a little bit further. And maybe "deeper" in the wrong direction.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Debugging methodology - there are others though.
Start removing or commenting out code until the error goes away. Obviously you must give some thought to exactly which code you do this to.
Then when the error goes away you have found the problem.
Then you can create a much smaller example code to test that functionality and figure out how to make it work correctly. Then you fix the original code and put everything else back.
|
|
|
|
|
I have developed an HR system in MS Access and want to use a camera attached to the computer to capture staff pictures on the form to store in a table with link as staff number of employee.
I asked once and I was directed to a sample code which I copied and used but it does not work.
can someone be of help?
|
|
|
|
|
Opam Brown wrote: a sample code which I copied and used but it does not work. can someone be of help? With what? We have no idea what code you are using or what problems you have encountered.
|
|
|
|
|
No code, no errors... no problem.
|
|
|
|
|
Opam Brown wrote: can someone be of help?
I suspect a paid consultant might be able to fix it. Or perhaps determine that is not even possible as code - thus a process with manual steps might be put in place.
Someone else might be able to help if you reduce the problem to a very small sample and then provided exact details for that.
|
|
|
|
|
You mean take a picture without their consent? In any "sane" situation, the user indicates "ready"; which is the same as monitoring the picture folder based on their say so; i.e. "they" push the thing that snaps their picture and signal the app accordingly.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
|
|
Yes, it can even make coffee.
|
|
|
|
|
|
Maybe I should have stated as a "Tongue In Cheek" remark, used as a backend to control and manage mixing of ingredients etc. it can ensure a great cup of relax.
|
|
|
|
|
It's ok - I understood your comment ... but I can't miss my comment to yours ...
|
|
|
|
|
Currently I use VB for
1) Windows services - Processing file messages into database transactions
2) Schedule data extractions - Monthly SQL extracts, reports, Excel, etc
Anything that requires a User Interface, I develop a Web Application, anything that requires background execution I develop in VB.
|
|
|
|
|
Private Sub OpenFolder_Click(sender As Object, e As EventArgs) Handles OpenFolder.Click
FolderBrowserDialog1.ShowDialog()
FolderPath.Text = FolderBrowserDialog1.SelectedPath.ToString()
loadfiles()
End Sub
Private Sub loadfiles()
Dim filepath As String() = Directory.GetFiles(FolderPath.Text)
Dim dt As DataTable = New DataTable
dt.Columns.Add("Product")
dt.Columns.Add("Serial No")
dt.Columns.Add("Extension")
dt.Columns.Add("Size")
dt.Columns.Add("Creation Time")
For item As Integer = 0 To filepath.Length - 1
Dim file As New FileInfo(filepath(item))
Dim dr As DataRow = dt.NewRow()
dr(0) = file.Name.Split.Distinct
dr(1) = file.Name
dr(2) = file.Extension
dr(3) = file.Length
dr(4) = file.LastWriteTime
dt.Rows.Add(dr)
Next
DataGridView1.DataSource = dt
End Sub
|
|
|
|
|
Quote: I was thinking About anything in particular?
|
|
|
|
|
How I can use the datagridview1 results after applying filters and file names to copy from Folder A to Folder B.
|
|
|
|
|
|
Opening an existing vb.net winforms solution and out of nowhere is generating over a hundred errors, most of which are like BC30456 'Black' is not a member of 'Color, or 'SelectedIndex' is not a member of 'VisualStyleElement.ComboBox'. Normal elements. Also a smattering of some BC30311 Value of type 'TextBox' cannot be converted to 'VisualStyleElement.TextBox'.
Seemingly hit and miss errors in some 10k lines of code. Updated, built, and published on Saturday with no issues.
Anyone else seen anything like this?
|
|
|
|
|
Are you getting errors on Using statements at the top of the code files? You're probably missing a reference to a library, like System.Windows.Forms.dll.
|
|
|
|
|
Hey Dave,
You're a lifesaver
VS had self-added (???) these to the main form:
Imports MS.Internal
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
Libraries in this haven't changed in two years, so I never thought to give this a look. Those two were responsible for all the errors.
Where they came from? My only guess is that on Saturday, that computer was in 'update hell'; meaning it had downloaded an update but needed a reboot and I didn't notice it. For unrelated reasons, it runs 24/7. It took three times to get the update flag cleared, and I'm pretty sure I opened the project after the first update said it was done.
I should have known better, since I know VS doesn't use the in-memory loaded libraries in update hell, but was doing a few different things on different computers so I missed it. Though in the past, I've never seen it add libraries on its own; it normally throws "missing" errors.
Thanks again for the clue.
Mike
|
|
|
|