I like to provide a dialog with a changing tooltipsection depending on the selected action. Doing it with a label is possible, but formating all the different textsections with a whole bunch of %CRLF% are a little bit confusing

Moderators: JRL, Dorian (MJT support)
Using functions already on the forum I was able to make a memo field transparent and scrollbarless. I could not seem to eliminate the border. Applying the function that removes borders from dialogs to the memo object:Is it possible to configure a memofield with transparency and without borders and the scrollbar?
Code: Select all
LibFunc>user32,SetWindowLongA,sres,Dialog1.msMemo1.handle,-16,1
Code: Select all
Dialog>Dialog1
Caption=Transparent Memo Field
Width=752
Height=581
Top=CENTER
Left=CENTER
Memo=msMemo1,33,23,680,466,
Button=Close,328,514,75,25,2
EndDialog>Dialog1
Show>dialog1
//constants
Let>GWL_EXSTYLE=-20
Let>WS_EX_LAYERED=524288
Let>LWA_COLORKEY=1
//get style attributes of dialog1 window
LibFunc>user32,GetWindowLongA,attribs,dialog1.handle,GWL_EXSTYLE
Let>attribs={%attribs% OR %WS_EX_LAYERED%}
//make selected color transparent
LibFunc>user32,SetWindowLongA,swl,dialog1.handle,GWL_EXSTYLE,attribs
LibFunc>user32,SetLayeredWindowAttributes,res,dialog1.handle,16777215,0,LWA_COLORKEY
//Eliminate the scrollbars
LibFunc>user32,ShowScrollBar,sbres,dialog1.msMemo1.handle,3,0
Label>Loop
GetDialogAction>Dialog1,res1
If>res1=2
Exit>0
EndIf
Wait>0.01
Goto>Loop
In my dialog the tooltipsection got another background color. So if I need to use a non transparent memofield it looks real awfulbut I'm not understanding the desire for transparency.
Code: Select all
//A dialog to be the text showcase.
Dialog>Dialog1
Caption=D~L~o~g1
Top=-1000000
Label=,12,8,True
EndDialog>Dialog1
Show>Dialog1
LibFunc>user32,SetWindowLongA,sres,Dialog1.handle,-16,1
CloseDialog>Dialog1
//Visual aid separator for each tooltip block
////****************************************************************
//The text to be displayed in our dialog
Let>Text=Start with a borderless dialog. Give the dialog a color and a line of text to display.
//Bob Hansen's word wrap RegEx sequestered in a subroutine.
//Usage:
//GoSub>WordWrap,Wrap Length,String
GoSub>WordWrap,30,Text
//Usage:
//GoSub>ToolTip,Xpos,Ypos,Wide,Tall,Text[,Font,Size,Style,TextColor[,BackColor]]
GoSub>ToolTip,500,100,200,90,WordWrapResult,Arial,12,0,16646144,6881279
//Display the message for a moment then close the window
Wait>6
CloseDialog>Dialog1
////****************************************************************
Let>Text=Adjust the size of the dialog to make the dialog encompass the text but not be overly large.
GoSub>WordWrap,30,Text
GoSub>ToolTip,500,200,310,310,WordWrapResult,Arial,12,0,16646144,6881279
Wait>6
CloseDialog>Dialog1
////****************************************************************
Let>Text=Adjust the size of the dialog to make the dialog encompass the text but not be overly large.%CRLF%%CRLF%Hmmmm...
GoSub>WordWrap,30,Text
GoSub>ToolTip,500,200,310,310,WordWrapResult,Arial,12,0,16646144,6881279
Wait>3
CloseDialog>Dialog1
////****************************************************************
Let>Text=Adjust the position of the dialog on the screen, the size and color of the text and even the dialog background color.
GoSub>WordWrap,30,Text
GoSub>ToolTip,500,300,310,120,WordWrapResult,Arial,16,0,255,6881210
Wait>9
CloseDialog>Dialog1
////****************************************************************
Let>Text=Good luck
GoSub>WordWrap,30,Text
GoSub>ToolTip,500,100,190,60,WordWrapResult,Arial,25,0,255,6881279
Wait>3
////****************************************************************
Let>Text=Good luck, GoodBye...
GoSub>WordWrap,11,Text
GoSub>ToolTip,500,100,190,90,WordWrapResult,Arial,25,0,255,6881279
Wait>2
//Open Dialog4 script
Libfunc>user32.dll,AnimateWindow,Result,Dialog1.handle,1000,262160
//Close Dialog4 script
Libfunc>user32.dll,AnimateWindow,Result,Dialog1.handle,1000,327696
////****************************************************************
SRT>ToolTip
Let>Dialog1.mslabel1=ToolTip_var_5
ResetDialogAction>Dialog1
Show>Dialog1
SetDialogObjectColor>Dialog1,,ToolTip_var_10
SetDialogObjectFont>Dialog1,mslabel1,ToolTip_var_6,ToolTip_var_7,ToolTip_var_8,ToolTip_var_9
LibFunc>user32,ShowScrollBar,sbres,Dialog1.handle,3,0
MoveWindow>D~L~o~g1,ToolTip_var_1,ToolTip_var_2
ResizeWindow>D~L~o~g1,ToolTip_var_3,ToolTip_var_4
LibFunc>user32,ShowScrollBar,sbres,Dialog1.handle,3,0
END>ToolTip
SRT>WordWrap
Let>vNeedle=(.{1,%WordWrap_var_1%})(%SPACE%|$)
Let>vHaystack=%WordWrap_var_2%
RegEx>%vNeedle%,%vHaystack%,0,matches,matchnum,1,$1%CRLF%,WordWrapResult
END>WordWrap