View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
gkelle[_3_] gkelle[_3_] is offline
external usenet poster
 
Posts: 1
Default change caption font color at runtime

The following code creates checkboxes on a form at runtime
I'm trying to change the font color of the caption

For iColumn = constStartColumn To i_NUMCOLUMNS
Set ctlMyControl = frmEditPartVolume!
frWhereUsed.Controls.Add("Forms.CheckBox.1")
Next iColumn

iLeft = iHorizSpacing
iTop = iVertSpacing

iTotalControls = frmEditPartVolume!frWhereUsed.Controls.Count
iColumn = constStartColumn
For Each ctlMyControl In frmEditPartVolume!frWhereUsed.Controls
ctlMyControl.Caption = Worksheets("Part List").Cells(10,
iColumn)
ctlMyControl.Left = iLeft
ctlMyControl.Height = iCheckBoxHeight
ctlMyControl.Font.Size = 8.25
crashes at this point
ctlMyControl.Font.ColorIndex = 3

ctlMyControl.AutoSize = True


---
Message posted from http://www.ExcelForum.com/