Jump to content

Expand List Items


lbrtdy
 Share

Recommended Posts

I have a question that I can not find online or in the help file.

Say I have a Guictrlcreatelist that is a certain height and width, the items in the list are longer than the width of the list itself so only part of it shows up. If I highlight the item, how do I make it so that it the highlighted thing expands showing the entire contents, perhaps in a tool tip?

I found a post by Siao and he posted something similar about using MouseOver:

GUISetOnEvent($GUI_EVENT_MOUSEMOVE, "On_MOUSEMOVE")


Func On_MOUSEMOVE()
    Local $aCI = GUIGetCursorInfo(), $aCtrlPos, $x, $sText = ""
    If @error Or $aCI[4] <> $List1 Then Return GUICtrlSetData($Input2, $sText)
    $aCtrlPos = ControlGetPos(@GUI_WinHandle, "", $aCI[4])
    $x = _GUICtrlListBox_ItemFromPoint($aCI[4], $aCI[0]-$aCtrlPos[0], $aCI[1]-$aCtrlPos[1])
    If $x > -1 Then $sText = _GUICtrlListBox_GetText($aCI[4], $x)
    GUICtrlSetData($Input2, $sText)
EndFunc

I can change it so that it shows a tooltip instead of changing $Input2's data, but I can't use any of the other buttons on my form1. But if I turn off Opt("GUIOnEventMode", 1) all my GUI buttons work again.

So I guess there's really two questions here:

1)How do I make something that's in a list expand in perhaps tooltip form when I select it/mouse over it. Or if there is no such option:

2)How come when I turn on Opt("GUIOnEventMode", 1) my gui Buttons no longer work? I mean the post by Siao works perfectly for my purposes, but it just disables every button I created so.. that defeats the purpose.

Thanks for your help!

Edited by lbrtdy
Link to comment
Share on other sites

Ibrtdy, I have faced the same problem, but I've solved with a gui: when an item in the list is double-clicked, it opens a gui with info from the other columns. Maybe this is useful to you. And also Melba's GuiExtender.

M.I.

Edited by taietel
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...