Panel中不显示内容?
Private Sub star_buku()
.......
.......
show_buke(pai_a, 790, 10, panela) ' ' 'pai_a 为字符串,是用来做排序大小的,用冒泡方法排序后的顺序. 790,10 是生成PictureBox 的最后一个控件的坐标的x,y panela 为Panel控件的Name
show_buke(pai_b, 790, 450, panelb)
End Sub
Private Sub show_buke(ByVal str_buke As String, ByVal x As Integer, ByVal y As Integer, ByVal panel As Panel)
panel.Controls.Clear()
Dim strs1 As String = str_buke
Dim i As Integer
Dim strs1nums() As String
strs1nums = strs1.Split( ", ")
Dim strs1_len As Integer = UBound(strs1nums)
strs1_len = strs1_len - 1 ' ' ' '(存在的最大的数从0开始,人为的多创造了一组数=“”)
' ' ' ' ' ' ' ' ' ' ' ' ' '显示牌
For i = 0 To strs1_len
Dim ss As String = strs1nums(i)
Dim pic As New PictureBox
pic.ImageLocation = "buke/ " & ss & ".png "
pic.Name = ss
pic.Location = New System.Drawing.Point(x - i * 30, y)
pic.Width = 94
pic.Height = 125
AddHandler pic.Click, AddressOf pic_Click
AddHandler pic.MouseDown, AddressOf pic_leftMouse
panel.Controls.Add(pic)
If i = strs1_len Then
MsgBox(pic.Location.Y)
End If
Next
txt2.Text = strs1
End Sub
panela 的这个可以显示了的
但是panelb 的这个还没有显示
是为什么呢?
好用一个按理说貌似第二个也应该可以好用呀, 是不是什么地方设置错了呢
找了好半天了,也没找到,还请指教!!!
我就能给上20了最多=_=
[解决办法]
恭喜楼主问题解决,接分吧!