BinaryBrother Posted January 15 Posted January 15 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
Fritterandwaste Posted April 25 Posted April 25 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 Melba23 Posted April 26 Author Moderators Posted April 26 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 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Fritterandwaste Posted April 26 Posted April 26 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.
Fritterandwaste Posted April 26 Posted April 26 (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 April 26 by Fritterandwaste Further question
Moderators Melba23 Posted April 26 Author Moderators Posted April 26 Fritterandwaste, No probs - glad you got it working. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
WildByDesign Posted 11 hours ago Posted 11 hours ago 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 Melba23 Posted 11 hours ago Author Moderators Posted 11 hours ago 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 WildByDesign 1 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
WildByDesign Posted 11 hours ago Posted 11 hours ago 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now