View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default change caption font color at runtime

ActiveX controls don't have a colorindex property.

ctlMyControl.forecolor = vbRed

--
Regards,
Tom Ogilvy

"gkelle " wrote in message
...
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/