2012-09-11 111 views
0

我在框架(框架1)內有一個單選按鈕。在第2幀,我有一些複選框。當從frame1中選擇單選按鈕時,此幀(frame2)變爲可編輯。我怎樣才能修改我的代碼,使frame2的forecolor的標題也改變?更改框架標題forecolor

我已經嘗試將以下內容添加到已啓用框架的邏輯中,但不起作用。

frame2.ForeColor = vbRed (should work?) 
frame2.Caption = vbRed 

我也試過十六進制顏色代碼,沒有看。 任何人都可以建議嗎?

使用枚舉來分配單選按鈕。

(在全局聲明實測值)
私人枚舉 ExampleRef optB1_blah = 1 等... optB5_blah = 4 結束枚舉

(該代碼在一個函數找到)

If Example(ExampleRef.optB5_radiobtnchoice).Value Then 
'//bug fix - 
frame2.ForeColor = vbRed 
    '//If Not statement with unrelated logic 

    If vblnShowErrors Then 
     Err.Raise 10000, VALIDATION, "error, you cant make this choice." 
    End If 

    blnDataFail = True 
    End If 
End If 

blnMinData = Not blnDataFail 
End If 
+0

frame2.ForeColor = vbRed * should * work,我剛剛測試過它。 – LittleBobbyTables

+0

另外,您使用單選按鈕的事件是什麼?點擊?的GotFocus?還有別的嗎? – LittleBobbyTables

+0

如果optExample(ExampleRef.optB5_radiobtn5).Value'//然後執行一些邏輯 – GrumP

回答

0

修復了這個問題,我正在尋找錯誤的功能,漫長的一天! frame.ForeColor = X語法很好。