VBControlExtender


Sample:

Dim WithEvents myStateList As VBControlExtender(Me)
Dim myStateItems() As PictureBox 
 
Public Sub Form_Load()
 
   Dim tmpStateItem As PictureBox
 
   Const maxX As Integer = 15
   Const maxY As Integer = 10
 
   Const offsetX As Integer = 10
   Const offsetY As Integer = 10
 
   Const itemWidth As Integer = 23
   Const itemHeight As Integer = 10
 
   Dim x As Integer, y As Integer, v As Integer
 
   ReDim myStateItems((maxX + 1) * (maxY + 1))
   For x = 0 To maxX
  	For y = 0 To maxY
     	   v = v + 1
     	   tmpStateItem = New PictureBox()
     	   myStateItems(v) = tmpStateItem
     	   Call myStateList.AddControl("test" + x + "|" + y, _
                                       tmpStateItem, _
                                       x * itemWidth + offsetX, _
                                       y * itemHeight + offsetY, _
                                       itemWidth, itemHeight, True)
  	Next
   Next
 
   v = 0
   For x = 0 To maxX
  	For y = 0 To maxY
     	v = v + 1
     	myStateItems(v).BackColor = IIF(Rnd > 0.5, vbRed, vbGreen)
   	Next
   Next
 
 
End Sub
 
Public Sub myStateList_Click(ControlID As String)
   MsgBox ControlID + " pressed!"
End Sub

Retrieved from "http://www.jabaco.org/wiki/VBControlExtender"

This page has been accessed 5,544 times. This page was last modified on 12 June 2009, at 13:48.


This page has been accessed 5,544 times. This page was last modified on 12 June 2009, at 13:48.