Checkbox doesn't have the OnFormat trigger?

NaviDevNaviDev Member Posts: 365
Hello,

I have this form with a table box control. Inside the table box are textboxes and radioboxes. I have modified the OnFormat triggers of the textboxes to put forecolors on it, but why is this radiobox doesnt have the OnFormat trigger? What I want actually is to have the a higlighted line when and where ever i put my cursor. I know the logic on how to do it in textboxes. But too bad not in radiobox. Please suggest me what to do.

Many Thanks in advance.
Navision noob....

Comments

  • garakgarak Member Posts: 3,263
    :-k a radio button makes no sense in a list box. Which option should it display?
    So, if you have options and you will display the options in the list form, use a tesxtbox. Now you have also the OnFormat() Trigger.

    Regards
    Do you make it right, it works too!
  • NaviDevNaviDev Member Posts: 365
    Sorry, i was already confused :shock: . I dont mean radioboxex, its checkboxes.
    Navision noob....
  • DenSterDenSter Member Posts: 8,304
    You sound surprised that there is no OnFormat event for a checkbox. How do you want to format a checkbox?
  • NaviDevNaviDev Member Posts: 365
    Hello Sir DenSter,

    What I want is to have forecolor on the active line in that checkbox control.
    Navision noob....
  • DenSterDenSter Member Posts: 8,304
    Like a red checkmark or something?
  • NaviDevNaviDev Member Posts: 365
    No. I want a color(something to highlight) the active line(where the cursor). Thanks
    Navision noob....
  • garakgarak Member Posts: 3,263
    Do you mean something (the style) like this :?:

    But a checkbox can't be colored or selected. So, if you really need it, us a textbox for your bool variable.
    Do you make it right, it works too!
  • NaviDevNaviDev Member Posts: 365
    Yes like those lines. But why is it that in the checkbox is it not highlighted?
    Navision noob....
  • garakgarak Member Posts: 3,263
    NaviDev wrote:
    Yes like those lines. But why is it that in the checkbox is it not highlighted?

    Because a checkbox has no OnFormat() ;-)

    So, if you really need it, us a textbox for your bool variable, then u have the OnFormat trigger

    Regards
    Do you make it right, it works too!
  • NaviDevNaviDev Member Posts: 365
    Seems like I have no choice. :cry:

    But how about for the picture box? I also use them inside my tablebox. I cannot use a textbox as a replacement for the picturebox. Is there anyways for picturebox?
    Navision noob....
  • MBergerMBerger Member Posts: 413
    If the field doesn't have to be editable, then there is a way to simulate a checkbox using a textbox.
    Make a function Formatboolean, input parameter a boolean ( i call it "value" in the following code ). Returns a text with length 1
    if value then
      exit('a')
    else
      exit ('') ;
    

    Then add a textbox to your table, set the sourceexpression to "FormatBoolean(<your boolean value>)" and set the font of that field to Marlett ( you might have to fiddle with the fontsize a bit ).
  • reijermolenaarreijermolenaar Member Posts: 256
    Hi MBerger,

    That is a nice trick! \:D/

    If you put this in the OnFormat trigger of the textbox you can even filter on it:
    IF Text = FORMAT(TRUE) THEN
      Text := 'a'
    ELSE
      Text := '';
    
    Reijer Molenaar
    Object Manager
  • reijermolenaarreijermolenaar Member Posts: 256
    To be clear, make a textbox with the following properties.
    Then you can filter on the boolean field with F7.
    { 1100512006;TextBox;1482 ;2860 ;1700 ;440  ;Editable=No;
                                                     ParentControl=1100512000;
                                                     InColumn=Yes;
                                                     HorzAlign=Center;
                                                     FontName=Marlett;
                                                     FontSize=10;
                                                     DropDown=No;
                                                     SourceExpr="Boolean Field";
                                                     OnFormat=BEGIN
                                                                IF Text = FORMAT(TRUE) THEN
                                                                  Text := 'a'
                                                                ELSE
                                                                  Text := '';
                                                              END;
                                                               }
    
    Reijer Molenaar
    Object Manager
  • MBergerMBerger Member Posts: 413
    Hi MBerger,
    That is a nice trick! \:D/
    Thanks. Same trick can be used on reports too !
Sign In or Register to comment.