web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

How to change the text colour of field using X++

Muhammad Yasir Profile Picture Muhammad Yasir 1,023
Hi,

Today i am going to discuss how to change the text colour of StringEdit contol through X++ code.

For that drop a StringEdit control named as 'TextControl' on a form. 
Set its AutoDeclaration property to 'Yes'.
In the run method of the form, write the following code.


TextControl.colorScheme(FormColorScheme::RGB);
TextControl.foregroundColor(WinAPI::RGB2int(255,0,0));

That's it. The text colour of the Name field appears red.


Happy coding!


This was originally posted here.

Comments

*This post is locked for comments