focus event

hi guys

i wanna make when a text control is being focus the
background change it color i.e. yellow & when the user
change to the next text control the next text control
do the same thing while the first one background color
back to original.

i try using EVT_SET_FOCUS yaa it works but if i
entered something to that text control not when i
focuse it with mouse click (or i should add another
event for this :frowning: )

when i chage to the next text control the first one
still wont change it background color to the original
like i wanted to, it change when i click it.

What's wrong with this event or I got mixed up?

聽聽聽聽聽聽聽聽EVT_SET_FOCUS(self.IsiNamaDepan,
self.OnIsinamadepanSetFocus)
聽聽聽聽聽聽聽聽EVT_KILL_FOCUS(self.IsiNamaDepan,
self.OnIsinamadepanKillFocus)
聽聽聽聽聽聽聽聽EVT_TEXT_ENTER(self.IsiNamaDepan,
wxID_ADDRESSFRAMEISINAMADEPAN,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽self.OnIsinamadepanTextEnter)

聽聽聽聽def OnIsinamadepanSetFocus(self, event):
聽聽聽聽聽聽聽
self.IsiNamaDepan.SetBackgroundColour(wxColour(255,
255, 174))

聽聽聽聽def OnIsinamadepanKillFocus(self, event):
聽聽聽聽聽聽聽
self.IsiNamaDepan.SetBackgroundColour(wxColour(255,
255, 255))

聽聽聽聽def OnIsinamadepanTextEnter(self, event):
聽聽聽聽聽聽聽
self.IsiNamaDepan.SetBackgroundColour(wxColour(255,
255, 255))
聽聽聽聽聽聽聽聽self.IsiNamaBelakang.SetFocus()

I try this & it wont worked

路路路

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

danu kusmana wrote:

hi guys

i wanna make when a text control is being focus the
background change it color i.e. yellow & when the user
change to the next text control the next text control
do the same thing while the first one background color
back to original.

i try using EVT_SET_FOCUS yaa it works but if i
entered something to that text control not when i
focuse it with mouse click (or i should add another
event for this :frowning: )

when i chage to the next text control the first one
still wont change it background color to the original
like i wanted to, it change when i click it.

Have you tried calling Refresh on the controls after changing their colours?

路路路

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!