嗯,我有一個在VB.NET上動態創建控件的列表,我想給它賦值。爲在VB.NET中動態創建的特定控件賦值
Dim widaco As Integer = 126 'width value
Dim value As String = File.ReadAllText(".\Test.ini")
Dim cuenta As Integer = Find_String_Occurrences(value, "2ç0k") - 1
Dim Array_Size As Integer = cuenta
ReDim pcb_(Array_Size)
For pcb_num = 0 To Array_Size
Application.DoEvents()
'deel = Math.Abs(Int(Panel1.AutoScrollPosition.Y.ToString)) \ altur + 2
pcb_(pcb_num) = New PictureBox
pcb_(pcb_num).BackColor = Color.FromArgb(255, pcb_num * 3, pcb_num * 2, pcb_num)
pcb_(pcb_num).Height = 77
pcb_(pcb_num).Width = widaco
pcb_(pcb_num).Left = 36
pcb_(pcb_num).Top = 85 * pcb_num + 15
pcb_(pcb_num).BackgroundImage = Image.FromFile(".\Art\im\" & pcb_num + 1 & ".png")
pcb_(pcb_num).Image = Image.FromFile(INI_Manager.Load_Value(".\Test.ini", "FuncImg-" & pcb_num))
pcb_(pcb_num).Tag = pcb_num
'pcb_(deel).Width = 200
Me.Controls.Add(pcb_(pcb_num))
pcb_(pcb_num).Parent = Panel1
AddHandler pcb_(pcb_num).Click, AddressOf pcb_Click
Next
好吧,deel不起作用,我想放大滾動的中央圖像,但我不能。 :(我已經註釋掉了這一行,因爲如果不是這樣的話,我會導致一個錯誤(滾動圖像不收費)
我已經把它放在Form Shown事件上,但.. 。這是行不通的:P
Pleade提供錯誤消息。 – Micha
沒有例外,只有滾動中的圖像不會像前面說的那樣收費 – Seazoux