dynamically change text box background color?

MBCrush
Member Posts: 6
I am currently running Navision Financials 2.6 .. is there a way to dynamically modify the background color of a text box on forms? :?:
0
Comments
-
On a form you can only change the following with code:
-
Indent
Selected
Editable
ForeColour
FontBold
so I guess the answer is no :roll:Remember: Keep it simple0 -
Or you have to play with different Shapes (in different colour) and make them VISIBLE or not depending of your needs ...0
-
bummer .. would have worked out nice for my new project ..0
-
There is nothing impossible in IT world...
The approach described below works only for card type forms
Create an edit box
set a font of this edit box to be WingDings
Add a block character as sourceexpression ('n')
Make the character BIG (I used size 300)
Disable borders, focusing
Create another edit box on top of first and assign field/variable as you usually do
Set the BackTransparent property to TRUE
Now- if you change (dynamically) the foreground color ofthe first edit the user will see the background of the second edit changing...0 -
You could also create a bunch of textboxes in various colors with the same source expression, put them all in the same xpos and ypos and only show the one (using the VISIBLE property in your C/AL code) with the right color. This would work with both card type and list type forms, only with list type forms, the user can make all of them visible.0
-
great tip, thank you .. unfortunately, though, my particular need is to be able to dynamically change the background of a particular field on a particular row of a list subform (ie - set the background on the "Sales Line".Description of the Sales Order subform to a different color (light grey) to denote a particular situation .. changing the font works, but changing the background gives a much better feel to my users .. hmmm, I wonder if I can implement a variation of your tip to accommodate my need .. time to experment again!0
-
Naturally, there is always a possibility to design your own font - what would be displayed in reverse, so that the foreground change will actually change the background. ;-)
Maybe there is something like this on the net...0 -
One more idea
If you need to alternate between 2 colors you can use the UPDATESELECTED function in OnFormat trigger.
I am using it in synchronized windows to show the position of the cursor in slave window. It can be quite tricky, but still can be managed.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions