タイトル : Re^7: ラベルでイベントが起こらなくなる 投稿日 : 2011/08/26(Fri) 10:24 投稿者 : YK
> あ、標準のLabelは反応します > しかしながら以前にも書いたようにBorderColorを変更できないと使えないので だったらBorderColorプロパティをもったコントロールを被せたら如何でしょうか。 Private Sub Form_Load() Dim i As Long Dim j As Long Dim cnt As Long Dim Lbl(159) As Label Dim Shp(159) As Shape With Me .Height = 10875 .Left = 120 .Top = 0 .Width = 14055 End With For i = 1 To 20 For j = 1 To 8 cnt = ((i - 1) * 8) + (j - 1) Set Lbl(cnt) = Controls.Add("VB.Label", "Label" & cnt) With Lbl(cnt) .Appearance = 0 .BorderStyle = 0 .Left = (j - 1) * 1680 + 270 .Top = (i - 1) * 500 + 210 .Height = 375 .Width = 1605 .Visible = True End With Set Shp(cnt) = Controls.Add("VB.Shape", "Shape" & cnt) With Shp(cnt) .BackColor = &H80000005 .BackStyle = 0 .BorderStyle = 1 .BorderColor = &HFF& .BorderWidth = 3 .Left = (j - 1) * 1680 + 270 .Top = (i - 1) * 500 + 210 .Height = 375 .Width = 1605 .Visible = True End With ReDim Preserve SubForm(cnt) Set SubForm(cnt) = New Form1 SubForm(cnt).Init Lbl(cnt) SubForm(cnt).fIndex cnt Next Next End Sub |