2 ta button
1 OpenFileDialog1
2 ta PictureBox
2 ta textbox
1 treeveiw
1 ImageList
khob aval dar treeveiw ImageList ro feal mikonim chetor?
bar roye treeveiw click kon boro be menuye properties age begardi yeja neveshte ImageList uno feal kon alabte qablish ye ImageList bezari ha
dar 1ki az buttonha in codo benevis vase load kardane ax
1 OpenFileDialog1
2 ta PictureBox
2 ta textbox
1 treeveiw
1 ImageList
khob aval dar treeveiw ImageList ro feal mikonim chetor?
bar roye treeveiw click kon boro be menuye properties age begardi yeja neveshte ImageList uno feal kon alabte qablish ye ImageList bezari ha
dar 1ki az buttonha in codo benevis vase load kardane ax
- Code:
OpenFileDialog1.Multiselect = False
Dim Result As DialogResult = OpenFileDialog1.ShowDialog
If Result = Windows.Forms.DialogResult.OK Then
PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
TextBox2.Text = OpenFileDialog1.FileName.ToString
End If
- Code:
If TextBox1.Text <> "" Then
If IO.Directory.Exists(Application.StartupPath & "\Pic") = False Then
IO.Directory.CreateDirectory(Application.StartupPath & "\Pic")
Else
If IO.File.Exists(Application.StartupPath & "\Pic\List.txt") = False Then
FileOpen(1, Application.StartupPath & "\Pic\List.txt", OpenMode.Output)
FileClose(1)
End If
End If
Dim II As Integer
If TextBox2.Text <> "" Then
PictureBox1.Image.Save(Application.StartupPath & "\Pic\" & TreeView1.Nodes.Count + 1 & ".jpg")
ImageList1.Images.Add(TreeView1.Nodes.Count + 1, PictureBox1.Image)
II = TreeView1.Nodes.Count + 1
Else
II = 0
End If
Dim K As String = TreeView1.Nodes.Count.ToString
TreeView1.Nodes.Add(K, TextBox1.Text, II, II)
Dim Str As String = vbCrLf & K & "--" & TextBox1.Text & "--" & II
FileOpen(2, Application.StartupPath & "\Pic\List.txt", OpenMode.Append)
PrintLine(2, Str)
FileClose(2)
For Each Co As Control In Controls
If TypeOf Co Is TextBox Then Co.Text = ""
Next
PictureBox1.Image = PictureBox2.Image
End If