1. Edinson Nongrados
  2. PowerBuilder
  3. Wednesday, 3 February 2021 16:36 PM UTC

Good afternoon,

I have this doubt.

There is the possibility to customize or change the messageBox default icons as:

  • Information! (Default)

  • StopSign!

  • Exclamation!

  • Question!

  • None!

 

Edinson Nongrados

Accepted Answer
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 3 February 2021 16:49 PM UTC
  2. PowerBuilder
  3. # Permalink

The MessageBox function just calls a Windows API function of the same name.

Your best bet is to create a Response type window that looks like a MessageBox window.

Create a structure object with all the options, title text, and message text. Then use OpenWithParm passing the structure to the window. Something like:

s_msgbox lstr_msgbox

lstr_msgbox.title = "Error"

lstr_msgbox.text = "Something went wrong"

OpenWithParm(w_messagebox, lstr_msgbox)

If you want to get fancy you could also create a function object with arguments similar to MessageBox that would populate the structure and open the window.

 

The biggest issue you'll have is resizing the window to match the message text.

 

Comment
  1. Roland Smith
  2. Wednesday, 3 February 2021 16:52 PM UTC
I have a free HTML control you could use to format the message text. Look for PBHtml at the bottom of this page: https://www.topwizprogramming.com/tools.html
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.