Sign in to follow this  
Followers 0
Arctor

ToolTip one more time

9 posts in this topic

This is a continue of my Listbox Questions. But I made a new topic because it's independent of that.

Is there a difference between the normal ToolTip and changing the ToolTip with GuiSetControlEx?

I got the latest unstable. Multiline in a ToolTip works.

Tooltip("1st line"& @CRLF & "2nd line")
sleep(2000)

But with this There is no new line in the ToolTip.

FileChangeDir(@ScriptDir)
GUICreate("Title", 110, 110)
$listbox_1 = GuiSetControl ("list", "", 5,5,100,100)
GuiSetControlNotify()
GUISetControlData($listbox_1,"Item1|Item2|Item3")
;-------------------------------------------------
GuiShow()

While GUIMsg() <> -3
If GuiRead() = $listbox_1 Then
GUISetControlEx($listbox_1, 0 ,0 ,"1st line" & @CRLF & "2nd line")
EndIf
Wend

I made this example simple just that one can check this out. Normally I have very long items in the listbox and want to display them in ToolTip. So it's possible that the output exceeds the screen. But this would be no problem because I can change my Tabs to a CRLF with a StringReplace.

arctor

Share this post


Link to post
Share on other sites



@Valik

can we do something for Gui multiline tip? :D

Share this post


Link to post
Share on other sites

LOL!

Yes JPM - (I read that thread). And you are right. VALIK is the man for that job.

ToolTip is one of his favourites! :huh2:

VALIK ---> :D

Sorry, couldn't resist.

arctor

Share this post


Link to post
Share on other sites

@Valik

can we do something for Gui multiline tip? :D

I'll take a look at what the docs say, but I think it's set up the same way.

Share this post


Link to post
Share on other sites

In CreateTOOLTIP(), add these 3 lines:

RECT dtw;
GetWindowRect(GetDesktopWindow(), &dtw);
SendMessage(tthWnd, TTM_SETMAXTIPWIDTH, 0, (LPARAM)dtw.right);

They should go after the line:

GUICtrl[m_iLastDefined].hTip = tthWnd;

Share this post


Link to post
Share on other sites

In CreateTOOLTIP(), add these 3 lines:

RECT dtw;
GetWindowRect(GetDesktopWindow(), &dtw);
SendMessage(tthWnd, TTM_SETMAXTIPWIDTH, 0, (LPARAM)dtw.right);

They should go after the line:

GUICtrl[m_iLastDefined].hTip = tthWnd;
Thanks Valik that's solve the @Arctor issue :D

Share this post


Link to post
Share on other sites

Thank you both for noticing my suggestion.

Do your answers mean it's working in the next unstable?

arctor

Share this post


Link to post
Share on other sites

Thank you both for noticing my suggestion.

Do your answers mean it's working in the next unstable?

arctor

Yes, if Jon has time to integrate it :D

Share this post


Link to post
Share on other sites

Great! THX :D

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0