Rob's TIMSS Blog

My discoveries and ramblings of TIMSS/Personify.

Monday, July 16, 2007

TIMSS 6: Highlighting Data Behind a Button

If you have created a button with that opens a window, wouldn't it be nice to tell your user if there was data behind the button without clicking on it? You can through extender. When you load the screen, check to see if there is data behind the button. If there is, change it's attibutes to highlight the fact that there is data behind it. For example, if you had a button that opened a comments screen that had data stored in a table you created, in the appropriate event put:

strSQL = "Select * from USR_CUS_COMMENTS where master_customer_id='" & oMaster.Text & "' and Sub_customer_id=" & CInt(oSub.Text)

oRecDS = MyForm.ScriptingGetDataSetWithSQL(strSQL, "USR_CUS_COMMENTS")

If Not oRecDS is nothing Then
If oRecDS.Tables(0).Rows.Count > 0 Then

oButton.ForeColor = System.Drawing.Color.Red
Else
oButton.ForeColor = System.Drawing.Color.Black
End If
End If


Applies to: TIMSS6

0 Comments:

Post a Comment

<< Home