Click here to Skip to main content
15,845,404 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: listbox mass edit Pin
Member Alienoiz10-Jun-23 10:53
Member Alienoiz10-Jun-23 10:53 
GeneralRe: listbox mass edit Pin
Ralf Meier10-Jun-23 11:52
professionalRalf Meier10-Jun-23 11:52 
GeneralRe: listbox mass edit Pin
Richard MacCutchan10-Jun-23 22:23
mveRichard MacCutchan10-Jun-23 22:23 
AnswerRe: listbox mass edit Pin
Richard MacCutchan10-Jun-23 22:11
mveRichard MacCutchan10-Jun-23 22:11 
AnswerRe: listbox mass edit Pin
Andre Oosthuizen13-Jun-23 0:59
mveAndre Oosthuizen13-Jun-23 0:59 
GeneralRe: listbox mass edit Pin
Member Alienoiz13-Jun-23 2:03
Member Alienoiz13-Jun-23 2:03 
GeneralRe: listbox mass edit Pin
Andre Oosthuizen13-Jun-23 3:43
mveAndre Oosthuizen13-Jun-23 3:43 
GeneralRe: listbox mass edit Pin
Member Alienoiz13-Jun-23 23:44
Member Alienoiz13-Jun-23 23:44 
Hi...sorry for the late reply...i think what you want is this
VB
myMp3.ID3v2Tag.Title = TextBox1.Text
                        myMp3.Write()



This is what i do..if:

i put this in the beginning of the code
VB
Public Class Form1


    Dim myMp3 As New UltraID3()


then use this to open and list the files:

VB
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      If FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then

          ListBox1.Items.Clear()
          Dim fileNames = My.Computer.FileSystem.GetFiles(FolderBrowserDialog1.SelectedPath, FileIO.SearchOption.SearchTopLevelOnly, "*.mp3")

          For Each fileName As String In fileNames
              Dim result As String = Path.GetFileName(fileName)
              ListBox1.Items.Add(result)
          Next


      End If
      Label1.Text = "Title :"
      Label2.Text = "Artist :"
      Label3.Text = "Album :"
      Label4.Text = "Year :"
      Label5.Text = "Track :"
      Label6.Text = "Comment :"
      Label7.Text = "Genre : "

  End Sub


then this to read and extract the tags into the labels text:
VB
<pre>    Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged

        If ListBox1.SelectedItem = "" Then
            On Error Resume Next
        Else

            myMp3.Read(FolderBrowserDialog1.SelectedPath & "\" & ListBox1.SelectedItem)

            Label1.Text = "Title : " & myMp3.ID3v2Tag.Title
            Label2.Text = "Artist : " & myMp3.ID3v2Tag.Artist
            Label3.Text = "Album : " & myMp3.ID3v2Tag.Album
            Label4.Text = "Year : " & myMp3.ID3v2Tag.Year.ToString
            Label5.Text = "Track : " & myMp3.ID3v2Tag.TrackNum.ToString
            Label6.Text = "Comment : " & myMp3.ID3v2Tag.Comments
            Label7.Text = "Genre : " & myMp3.ID3v2Tag.Genre
            On Error Resume Next
            Dim pics = myMp3.ID3v2Tag.Frames.GetFrames(CommonMultipleInstanceID3v2FrameTypes.Picture)
            PictureBox1.Image = CType(pics(0), ID3v2PictureFrame).Picture

        End If

    End Sub


and finally this code to write from textboxes into the file:
VB
<pre>Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click



        If ListBox1.SelectedItem = "" Then
            Dim r8 As DialogResult = MessageBox.Show(Me, "No File Selected!",
                                   "Select Files", MessageBoxButtons.OK)


        Else
            If CheckBox1.Checked = False And CheckBox2.Checked = False And CheckBox3.Checked = False And CheckBox4.Checked = False And CheckBox5.Checked = False And CheckBox6.Checked = False And CheckBox7.Checked = False And CheckBox8.Checked = False Then
                Dim r8 As DialogResult = MessageBox.Show(Me, "Select a tag to enter!",
                                  "Select Tags", MessageBoxButtons.OK)
            Else
                Dim fils = ListBox1.SelectedItems
                For Each item In fils


                    If CheckBox1.Checked = True Then
                        myMp3.ID3v2Tag.Title = TextBox1.Text
                        myMp3.Write()
                    End If

                    If CheckBox2.Checked = True Then
                        myMp3.ID3v2Tag.Artist = TextBox2.Text
                        myMp3.Write()
                    End If


                    If CheckBox3.Checked = True Then
                        myMp3.ID3v2Tag.Album = TextBox3.Text
                        myMp3.Write()
                    End If


                    If CheckBox4.Checked = True And TextBox4.Text <> "" Then
                        On Error Resume Next
                        myMp3.ID3v2Tag.Year = Short.Parse(TextBox4.Text)
                        myMp3.Write()

                    End If
                    If CheckBox5.Checked = True And TextBox5.Text <> "" Then
                        On Error Resume Next
                        myMp3.ID3v2Tag.TrackNum = Short.Parse(TextBox5.Text)
                        myMp3.Write()

                    End If
                    If CheckBox6.Checked = True Then
                        myMp3.ID3v2Tag.Comments = TextBox6.Text
                        myMp3.Write()
                    End If

                    If CheckBox7.Checked = True Then
                        If ComboBox1.Text = "01 - User" Then
                            myMp3.ID3v2Tag.Genre = TextBox7.Text
                            myMp3.Write()
                        Else
                            myMp3.ID3v2Tag.Genre = ComboBox1.Text
                            myMp3.Write()
                        End If

                    End If


                Next

            End If
            Dim r9 As DialogResult = MessageBox.Show(Me, "Operation Complete!",
                          "Tagged Files!", MessageBoxButtons.OK)
        End If
    End Sub


The thing LOADS and SAVES MP3 TAGs!!

i understand what the code does but im not able to generate it all...im more of a decoder then what i have from coder lo0l Smile | :)
GeneralRe: listbox mass edit Pin
Ralf Meier14-Jun-23 2:37
professionalRalf Meier14-Jun-23 2:37 
GeneralRe: listbox mass edit Pin
Member Alienoiz14-Jun-23 3:23
Member Alienoiz14-Jun-23 3:23 
GeneralRe: listbox mass edit Pin
Ralf Meier14-Jun-23 3:35
professionalRalf Meier14-Jun-23 3:35 
GeneralRe: listbox mass edit Pin
Member Alienoiz14-Jun-23 3:38
Member Alienoiz14-Jun-23 3:38 
GeneralRe: listbox mass edit Pin
Ralf Meier14-Jun-23 7:34
professionalRalf Meier14-Jun-23 7:34 
GeneralRe: listbox mass edit Pin
Andre Oosthuizen14-Jun-23 6:02
mveAndre Oosthuizen14-Jun-23 6:02 
GeneralRe: listbox mass edit Pin
Richard MacCutchan14-Jun-23 6:15
mveRichard MacCutchan14-Jun-23 6:15 
GeneralRe: listbox mass edit Pin
Ralf Meier14-Jun-23 7:31
professionalRalf Meier14-Jun-23 7:31 
GeneralRe: listbox mass edit Pin
Richard MacCutchan14-Jun-23 7:37
mveRichard MacCutchan14-Jun-23 7:37 
GeneralRe: listbox mass edit Pin
Member Alienoiz14-Jun-23 9:18
Member Alienoiz14-Jun-23 9:18 
GeneralRe: listbox mass edit Pin
OriginalGriff14-Jun-23 9:21
mveOriginalGriff14-Jun-23 9:21 
GeneralRe: listbox mass edit Pin
Member Alienoiz14-Jun-23 9:38
Member Alienoiz14-Jun-23 9:38 
GeneralRe: listbox mass edit Pin
Ralf Meier14-Jun-23 8:46
professionalRalf Meier14-Jun-23 8:46 
GeneralRe: listbox mass edit Pin
Member Alienoiz14-Jun-23 9:40
Member Alienoiz14-Jun-23 9:40 
GeneralRe: listbox mass edit Pin
Ralf Meier14-Jun-23 10:01
professionalRalf Meier14-Jun-23 10:01 
GeneralRe: listbox mass edit Pin
Richard MacCutchan14-Jun-23 9:55
mveRichard MacCutchan14-Jun-23 9:55 
GeneralMessage Closed Pin
15-Jun-23 2:19
mveAndre Oosthuizen15-Jun-23 2:19 

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.