以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  控件颜色问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=114658)

--  作者:douglas738888
--  发布时间:2018/2/12 15:01:00
--  控件颜色问题

请教老师,下面代码怎样写在AfterLoad能打开窗口就触发,现在是放在控件的TextChanged

 

Dim Tb As WinForm.TextBox = e.Form.Controls("TextBox2")
If Tb.Text = "立项设计" Then
    Tb.BackColor = Color.Green
    Tb.ForeColor = Color.Yellow
Else
    If Tb.Text = "技术标书" Then
        Tb.BackColor = Color.Blue
        Tb.ForeColor = Color.White                
            Else
                If Tb.Text = "" Then
                    Tb.BackColor = Color.WhiteSmoke
                    Tb.ForeColor = Color.Black
         End If
    End If
End If


--  作者:有点甜
--  发布时间:2018/2/12 15:07:00
--  

1、你afterLoad事件如何判断值?打开的时候textbox2的值是空白的。

 

2、你在afterLoad事件写代码,没有达到什么效果?


--  作者:douglas738888
--  发布时间:2018/2/12 15:13:00
--  

老师,我是从其他窗口打开加载的,其他窗口的代码(doubclick)如下       评价窗口本身打开不设置任何加载

 

Forms("评价").Open()
If Forms("评价").Opened Then
    If e.Table.Current Is Nothing Then

        Return \'则返回
    End If
    Dim dr2 As  DataRow
    dr2 = DataTables("工作策划副表").Find("[任务索引] = \'" & e.Table.Current("任务索引") & "\'")
    If dr2 IsNot Nothing Then
        Dim str As String = ""
        str  = dr2("任务索引")
        DataTables("评价_Table1").LoadFilter = "任务索引 = \'"& str &"\'"
        DataTables("评价_Table1").Load()
    End If
End If

[此贴子已经被作者于2018/2/12 15:17:38编辑过]

--  作者:有点甜
--  发布时间:2018/2/12 15:25:00
--  
你重新load的时候修改了textbox2的值?如果是,判断代码写到你load代码的后面