- Local time
- Today, 09:07
- Joined
- Feb 19, 2013
- Messages
- 16,607
I've provided my client with a simple notepad linked to forms based on a table of memo fields linked to the form name. It provides a help function and can be made editable as a means for users to add their own notes about what the form does, things to pay attention to etc.
I've been asked if they can use richtext functionality to provide colour/bold/italic etc.
The problem is the app hides the access window so they do not have access to the ribbon. And anyway the form is popup so even if they could see the ribbon, they still would not be able to access it.
I've provided some basic functionality with some formatting styled buttons which works providing the user does not overlap formats - if they do, it messes everything up.
So this is OK - hello world
but this is not - hello world
users being users - it gets messed up.
The issue is selstart, seltext and sellength return a value based on plain text - all formatting codes are ignored.
My current thinking is to have a two dimensional array of the formatting codes, one element providing the location within the plain text and the other the formatting code.
so the above full string including formatting is
<div><font color=red><u>hello</u></font><u> world</u></div>
my array stores
0...<div><font color=red><u>
5...</u></font><u>
11..</u></div>
I can then use selstart and sellength to interrogate the array to determine whether there is formatting code included and add it back in before updating the .text property (with the new formatting codes) and updating the array with the location and structure of the new codes.
But before going down this route, has anyone else tried an alternative solution (which works)?
Thanks in advance
CJ
I've been asked if they can use richtext functionality to provide colour/bold/italic etc.
The problem is the app hides the access window so they do not have access to the ribbon. And anyway the form is popup so even if they could see the ribbon, they still would not be able to access it.
I've provided some basic functionality with some formatting styled buttons which works providing the user does not overlap formats - if they do, it messes everything up.
So this is OK - hello world
but this is not - hello world
users being users - it gets messed up.
The issue is selstart, seltext and sellength return a value based on plain text - all formatting codes are ignored.
My current thinking is to have a two dimensional array of the formatting codes, one element providing the location within the plain text and the other the formatting code.
so the above full string including formatting is
<div><font color=red><u>hello</u></font><u> world</u></div>
my array stores
0...<div><font color=red><u>
5...</u></font><u>
11..</u></div>
I can then use selstart and sellength to interrogate the array to determine whether there is formatting code included and add it back in before updating the .text property (with the new formatting codes) and updating the array with the location and structure of the new codes.
But before going down this route, has anyone else tried an alternative solution (which works)?
Thanks in advance
CJ