Pointui » Home 2 Scripting Support

Is there any way to SendToBack an Icon of ButtonIcon

(2 posts)
  • Started 1 year ago by AKILalmaZZ
  • Latest reply from Joel
  • This topic is not resolved
  1. example code:

    ...

    ButtonIcon SomeButtonWithIcon;
    Image SomeImageOverTheButton;

    SomeButtonWithIcon.Image.LoadFromFile("....jif");
    SomeButtonWithIcon.ImageSelected.LoadFromFile("....jif");
    SomeButtonWithIcon.Icon.LoadFromFile("....jif");
    Controls.Add(SomeButtonWithIcon);

    SomeImageOverTheButton.Surface.LoadFromFile("....jif");
    SomeButtonWithIcon.Controls.Add(SomeImageOverTheButton);

    ....

    this code results a button with an icon but icon is in front of the image

    Yes I can inverse the Image-Icon sequence to get the image in front of all,
    logical is an icon must be in front of the button image but behind of any other controls added to this button.

    Best Regards
    Thanks in advance

    Posted 1 year ago #
  2. If you add SomeImageOverTheButton as a child of SomeButtonWithIcon then you have no control over z-order because they are parent-child. However, in this case even this wouldn't help. The children are always drawn after default drawing - this allows children to sit on top of the default rendered content which to me seems logical. You can achieve what you are trying by building your own button control which is a composite of a few controls.

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.