1. rohit ranjan
  2. PowerBuilder
  3. Friday, 22 May 2020 14:42 PM UTC

Hi,

How can we add icon (right or left) to editbox exactly like below -

 

Please help me with the control/property that i have to tamper with.

Thanks,

Rohit

John Fauss Accepted Answer Pending Moderation
  1. Friday, 22 May 2020 15:54 PM UTC
  2. PowerBuilder
  3. # 1

Greetings, Rohit -

There is no pre-packaged (i.e., standard) control or property that I know of to accomplish this. However, you can probably simulate the appearance using a single-column external source DataWindow object for the single-line edit, then placing a picture (jpg, png, etc.) of the magnifying glass over the column object in the foreground. Change the "Layer" property in the "Position" tab for the picture object in the DW Painter from "Band" (normal) to "Foreground".

I've not done this exact task as you describe, but I've done something similar in the past. You'll have to experiment a little. It would be better if the graphic's "background" was transparent, so that rules out using a bmp (bitmap).

Others may suggest alternative ideas. If you find something that works, please share your solution. Good luck!

Regards, John

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 22 May 2020 16:37 PM UTC
  2. PowerBuilder
  3. # 2

Hi Rohit;

   Similar to what John suggested but in my STD Framework, I created a Custom Visual User Object (CVUO) that implements an SLE, and Static Text (ST) object to mimic a "Hint Text" (aka "Place Holder Text") control, as follows:

  I did not incorporate the magnifier image into the CVUO because I wanted the ability of the App Developer to use the HT CVUO for any data input. The key is that the CVUO provides the base look & feel and script to hide/show the "Hint Text" when the SLE has or does not have datum.

  As a PB developer, if I inherit from the above ancestor CVUO and then add a picture of the magnifying image to the same background layer as the ST object, you would end up with the same GUI as you asked about.

Food for thought.

BTW: If you download the framework, the CVUO's that you are looking for are: "vc_mle_hinttext_master", "vc_sle_hinttext_master" and  "vc_em_hinttext_master". Feel free to use these as a design mold for creating your own CVUO for this purpose if you do not want to use my entire framework.  ;-)

HTH

Regards ... Chris

Comment
There are no comments made yet.
rohit ranjan Accepted Answer Pending Moderation
  1. Friday, 29 May 2020 13:02 PM UTC
  2. PowerBuilder
  3. # 3

Thanks a lot Chris and John, that was helpful.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.