Dynamic captionso on buttons
Mauddib
Member Posts: 269
I have just been reading all the search results I can find on this and no one seems to have done it.
Can you dynamically set the caption on a button on a form at runtime. Opopen or anything. I know you can do this with the captionclass property on the form for fields and so on, but it doesnt appear to work with buttons.
Anyone managed this with a DLL or OCX, or by changing captionclass in Codeunit 1 or anything?
Can you dynamically set the caption on a button on a form at runtime. Opopen or anything. I know you can do this with the captionclass property on the form for fields and so on, but it doesnt appear to work with buttons.
Anyone managed this with a DLL or OCX, or by changing captionclass in Codeunit 1 or anything?
0
Answers
-
I don't think you can change the caption of a Button at runtime in Navision based on some criteria, the main reason being the Property 'Caption' is not available at rutime for buttons.
However you can try this.
Create two buttons and provide different captions on them, now make them visible / non visible directly on the runtime based on the criteria..Place the two buttons ovelapping so during the runtime the user is able to see only one single button....
Oh...One more thing if you do this...do please use the documentation trigger to document the same..as this may create some confusion in the form buttons..Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/0 -
There is one way with layered EditBox and Transparent button. I described it one post but which one it was... :whistle:
Main idea was to have one button without caption which is doing the :shape: of the button, on it is edit box without borders and transparent with the dynamic caption, and on it third button, which fires the OnPush trigger and is doing the job (once again transparent and without borders etc...).0 -
Another idea: Not at runtime, but dynamic. Have a look to the captionclass thing.
Maybe this helps
Thomas0 -
Kine you either almost have it or you have it and i misunderstood your description!
An old colleuge just told me how to do it and its really easy. Its done the same way as the COMMENTS button on item card, sales order, purchase order etc etc.
Basically create a button with showcaption set to NO and Back Transparent set to YES.
Now create a textfield with source being a variable of type Text and place it over the button with same size as button.
Now you can change the value of the text variable and the 'caption' on the button appears to change. Wonderfully simple.0 -
When you resizes/maximizes the form, does the caption alligns with the button?No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Yes if all glue and size and position settings are the same.0
-
Mauddib wrote:Kine you either almost have it or you have it and i misunderstood your description!
:-) The described solution with two buttons and one edit box is the solution which is visually same as common button. Your solution with just one button and editbox have some visual differences (mainly under XP and Vista). It is why I am using two buttons... ;-)0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

