October 30, 2025, 04:12:19 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


On demand listview

Started by Rock Ridge Farm (Larry), February 08, 2006, 06:52:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rock Ridge Farm (Larry)

I am having a problem.
I am trying to build a dynamic listview. I want the list to appear when
selected by a button and go away when you leave the list.
I was trying to make this work like a dialog.
I am having no luck - help wanted.

Parker

February 08, 2006, 07:49:12 PM #1 Last Edit: February 09, 2006, 08:16:11 AM by Parker
I'm having a little trouble understanding what exactly it is that you want. So let me know if I get anything wrong.

You want a listview control that becomes filled when the user selects a button, and when the mouse leaves the control it should become empty?

Or you want the listview to suddenly appear? In that case you can use ShowWindow to hide/show it, I actually just wrote a bit of code for that to change between 3 treeviews or an edit based on the selected value of a combo box.
case WM_COMMAND
if (loword(wParam) = 2) and (hiword(wParam) = CBN_SELCHANGE) then
for i = 3 to 6
ShowWindow(GetDlgItem(hWnd, i), SW_HIDE)
next
ShowWindow(GetDlgItem(hWnd, SendMessage(GetDlgItem(hWnd, 2), CB_GETCURSEL, 0, 0)+3), SW_RESTORE)
end if

it would take a little conversion and a couple of constants defined. You can replace loword(wParam) with wParam & 0xFFFF, and replace hiword(wParam) with wParam >> 16.
Also there is an AnimateWindow function if you want it to be fancy and fade in, roll down, etc.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/animatewindow.asp

Rock Ridge Farm (Larry)

Actually - I want a menu item that when selected witll display the listview.
Then I want an exit button in the listview that will hide/close the listview.
I have played with this most of the night and have not made it work.
I can create a listview but have not figured out how to add the hide button
to the list view.

Parker

You're going to have a very hard time doing that. I think an easier way would be to add an item to either the top or bottom that says "Close me" or whatever you want it to say.

But if you want to embed a button, I think it would look nice. See this article on how to embed a button into a different control.