参考代码
If Forms("窗口1").Opened Then Dim txt As WinForm.TextBox = Forms("窗口1").Controls("textbox1") txt.ForeColor = Color.red txt.BackColor = Color.yellowEnd If