1. Jeff Martin
  2. PowerBuilder
  3. Monday, 8 May 2023 19:01 PM UTC

Wondering if anyone has been any success in implementing a command button with rounded corners?

I have made an attempt with a custom visual / user control (rounded rectangle with static text field). However when that user control is added to a window, if it is resized it will not resize/stretch all controls on the custom control in the design painter. I know I can add code to properly stretch it during runtime, but ideally I'd like to see the full size/stretch in design time as well.

I have also done some brief research on UI Themes, but that doesn't seem to offer what I am looking for either.

 

[Using PowerBuilder 2022 in windows environment]

Attachments (1)
Who is viewing this page
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 9 May 2023 01:39 AM UTC
  2. PowerBuilder
  3. # 1

Hi, Jeff -

It may be possible to create your own command button for use at runtime by using PowerBuilder Native Interface (PBNI) to create a "visual extension". I think you would create what Windows refers to as an owner-drawn control (the command button) in C++. You will need to be very comfortable with creating visual Windows controls in C++, including a windows procedure to handle event messages from the Windows O/S and route those message, when appropriate to the PowerBuilder Virtual Machine (PBVM). This is beyond my expertise, and I'm not aware of any example code. Perhaps there are others in the Appeon Community with the necessary skills and experience.

Here is a link to a discussion on visual extensions in PBNI:

    https://docs.appeon.com/pb2022/native_interface_programmers_guide_and_reference/XREF_72632_Creating_and_using.html

Another possibility would be to use a .NET control in your PB application. I've not done this, but it appears to be easier than created a visual extension in PBNI. I found a nice explanation online written in 2012 by Matt Balent:

    https://www.codeproject.com/Articles/408620/PowerBuilder-Using-NET-Visual-Controls-in-PB-Class

I hope this information leads you to a solution that works. If you find a solution, I'd be very interested to learn how it's done... so please report back.

Best regards, John

Comment
  1. Sivaprakash BKR
  2. Wednesday, 10 May 2023 05:21 AM UTC
Will be happy if included in the todo list of Appeon for creating a modern UI. A rounded button with ability to include a picture, Multi-Line HTML Text with alignment option.
  1. Helpful 1
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.