[.NET] 請問main menu的相關問題
請問货
如果我要利用Open開啟對話盒來選擇欲開啟的圖檔,並顯示在PictureBox中,同時在File下方會以分隔線區隔後顯示檔名;使得點選任一檔名,在PictureBox中會顯示其圖形。
下方會以分隔線區隔後顯示檔名;使得點選任一檔名,在PictureBox中會顯示其圖形。
mcount += 1
If mcount = 1 Then
dash.Text = "-"
MenuFile.MenuItems.Add(dash)
End If
Dim newmenu As New MenuItem
ReDim Preserve document(mcount)
newmenu.Text = OpenFileDialog1.FileName
document(mcount) = newmenu
MenuFile.MenuItems.Add(document(mcount))
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
OpenFileDialog1.Filter = "jpeg(*.jpg)|*.jpg|Allfile|*.*"
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
PictureBox1.Image = System.Drawing.Image.FromFile(OpenFileDialog1.FileName)
MenuClose.Enabled = True
End If
以上是我的程式碼,我所遇到的問題是在File下方會以分隔線區隔後顯示檔名這裡!
當我開啟第一張圖時,我顯示檔名那會先空一行,當我開啟第2張圖時,第二行才會顯示第一張的檔名
但是第二章的檔名就要等到第三張開啟時才會顯示!
因為前面的問題使得我也無法在上面點選檔名,來選取圖片!
請各位高手幫幫忙吧!
由衷的感謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 211.74.62.191