[Gtk-sharp-list] Changing the background and text color of a Gtk.Entry

Daniel Valcarce davamix at gmail.com
Fri Apr 28 11:15:14 EDT 2006


Hi,

You can use the methods ModifyBase and ModifyText of the Widget class.

------------------------------
myEntry.ModifyBase(StateType.Normal, new Gdk.Color(255,0,0));
myEntry.ModifyText(StateType.Normal, new Gdk.Color(0,255,0));
-----------------------------

Greetings.

El vie, 28-04-2006 a las 16:38 +0700, Agro Rachmatullah escribió:
> Is it possible to change the background and text color of a Gtk.Entry?
> If so, how?
> 
> My intention is to make the text of a Entry red if the user enters an
> invalid input (for example "foo" on an Entry that expects an integer).
> 
> (From hunting in Monodoc, it seems that it has to be something related
> to Gtk.Entry.Style. However the documentation is very minimal on that
> regard so I haven't made it work)
> 
> Thanks a lot.
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
-- 

----------------------
Daniel Valcarce Miranda

http://davamix.googlepages.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
	digitalmente
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20060428/a87e0eff/attachment.bin


More information about the Gtk-sharp-list mailing list