Home > Software engineering >  Vb dynamically added controls
Vb dynamically added controls

Time:09-26

I made a server and client one-to-many connection things
Added a dynamic inside add label and picture, the equivalent of the sock label picture is dynamically add
Attributes on the index on the three controls are written by 0, that is, all be regarded as the control group but running only the sock and the picture is the dynamic increase and the label is not increased, solving

 Private Sub Listener_ConnectionRequest (ByVal requestID As Long) 
Dim SockIndex As Integer: SockIndex=8888
Dim As Integer I
For I=0 To the sock. UBound
If the sock (I). The State=0 Then SockIndex=I

Next


If SockIndex=8888 Then


The Load Picture1 (Picture1. UBound + 1)
The Load Label1 (Label1 UBound + 1)
Load the sock (sock. UBound + 1)
SockIndex=Label1 UBound 'is this a problem, but do not understand what is going wrong, solving
SockIndex=Picture1. UBound
SockIndex=the sock. UBound
Picture1 (Picture1. UBound). The Visible=True
The Picture1 (Picture1. UBound). Left=I * 3000
Label1 (Label1 UBound). The Visible=True
Label1 (Label1 UBound). Left=I * 3000

End the If

The sock (SockIndex). Accept (requestID)
Picture1 (SockIndex). BackColor=& amp; HFF00 & amp;
Label1 (SockIndex). Caption=the sock (SockIndex). RemoteHostIP


End Sub

CodePudding user response:

Finally add a Label1 (Label1. UBound). Zorder try, may be blocked

CodePudding user response:

reference 1/f, stupid dog flew first response:
finally add a Label1 (Label1. UBound). Zorder try, maybe by blocking the
show come out, how can is blocked? Is the background image?

CodePudding user response:

Well, after adding controls the lower
Like the image, the label is a lightweight control that is equal to the painting directly in the form
, the picture is weight control, it is in the form layer

CodePudding user response:

reference stupid dog flew first reply: 3/f
well, add the controls after the lower
Like the image, the label is a lightweight control that is equal to the painting directly in the form
, the picture is weight control that is in the form above
thank you very much
  • Related