Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
change caption font color at runtime
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Checkbox to change background color, font color and remove/ add bo | Excel Discussion (Misc queries) | |||
Cannot change font color or cell color | Excel Discussion (Misc queries) | |||
Change in font and color | New Users to Excel | |||
how can I conditionally change font color, or background color? | Excel Worksheet Functions | |||
How to change the default Border, Font Color, and Cell Color | Excel Discussion (Misc queries) |