Jump to content

Recommended Posts

Posted

In C#, I would have to use

 MessageBox.Show(new Form { TopMost = true }, "A valid 10-digit phone number, including your area code, is required!", "ERROR");

 

SIGNATURE_0X800007D NOT FOUND

  • 3 months later...
Posted

Hi

Thanks for the UDFs.

Is there a way of widening the ExtMsgBox to accommodate longer strings that contain spaces? Do I understand correctly that the first width parameter will not support a width > 370 and the second max width parameter will only kick in when the string is unbroken - ie contains no white space? 

Many thanks. 

  • Moderators
Posted

Fritterandwaste,

I am delighted you find my UDFs useful.

The $iWidth parameter of _ExtMsgBoxSet determines the maximum width of the ExtMsgBox. So you can define any value over the default 370 pixels up to a maximum of @DesktopWidth - 20 and the ExtMsgBox should expand to display strings with spaces up to that width before adding linebreaks. You are correct in thinking that the $iWidth_Abs parameter is to deal with long unbroken strings.

I hope that is clear - if not then please post some examples which do not work as you expect and I will take a look.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

Thanks for the prompt reply and clarification. 

That's odd because I don't seem to be getting that result. If I deliberately add a long string of consecutive underlines (a workaround I can live with), it widens the message box but not when I increase the $iWidth parameter. I'll take another look.

Posted (edited)

Yes, my problem. I forgot I was already using my own (rather lame) version of your StringLength function and adding @CRLF and a @TAB at points in an attempt to format a standard MsgBox to wrap and indent when I wanted it to and this code was restricting the character width to which ExtMsgBox was automatically adjusting.

Sorry and thanks for putting me on the right track.

Can I risk another question - is it possible to define the font-weight? I'd quite like to make the text bold? 

Edited by Fritterandwaste
Further question
  • Moderators
Posted

Fritterandwaste,

No probs - glad you got it working.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

  • 5 months later...
Posted

This is one of the UDFs that I use the most and I am extremely thankful. I use it in basically all of my projects.

I have only one single issue with this UDF and perhaps there is a way to prevent it. Sometimes I would like to have the ability to use the @TAB macro to better align some text, particularly in an About type of dialog. But it seems that it likely causes an issue when the UDF measures the GUI space required and seems to always break the line.

I can use a whole bunch of spaces "       " to align some text, however, that does not line text up perfectly unless using a monospaced font. I would prefer to not use a monospaced font for this particular purpose.

Is there any trick to get the @TAB macro to work without breaking the line and causing the extended message box to have a smaller width?

  • Moderators
Posted

WildByDesign,

Have you tried using the "Expand tabs" option within the $iStyle parameter of _ExtMsgBoxSet ?

; Parameters ....: $iStyle          -> 0 (Default) - Taskbar Button, TOPMOST, button in user font, no tab expansion,
[...]
;                                          8   = Expand Tabs to ensure adequate sizing of GUI

That will auto-expand a @TAB into "XXXXXXXX", do the size calcultions and then reset the @TAB.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted
14 minutes ago, Melba23 said:

Have you tried using the "Expand tabs" option within the $iStyle parameter of _ExtMsgBoxSet ?

My apologies, I hadn’t noticed that option.

All of your UDFs are so thorough and feature-rich. I feel silly now for not realizing that you likely already had something in place for using TABs.

Have a wonderful weekend. :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   1 member

×
×
  • Create New...