Vb Listpanel

Hi Experts
I hope I explain this OK

I have a Object TestTemplate
Public Class TestTemplate

        inherits ListPanel

        Public sub New()
                'setup visible buttons
                Me.AddUserAction(BaseAction.Open, True, True, "&Open". True, My.Resources.Open.item. "Open Selected Item", False, True, 
                      False, Keys.None)
        end sub

        Protect Overrides ReadOnly Property selectCommand() as String
                     sharedvar.Selectfile = "Select * from File where index = 'A'"
                    return sharedvar.selectfile
        end Property 

        Private sub OpenItem()
                     sharedvar.Selecteditem = Me.SelectedItemKey.tostring
       end sub

end class

Open in new window

in my program I run
private sub mSelectButton_Click(byVal Sender as System.object, byVal e as System.EventArgs) Handles mButton.click
             dim alist as new testtemplate
             alist.showdialog('Test Template", me.company, true, 800, 300)
             ' This shows a list from file with index = 'A'
             ' When they double click on the list openitem() is triggered in the TestTemplate 
end sub

Open in new window

the selection.SelectFile and selection.Selecteditem are setup as
Pubic Class selection
          public shared selectfile as String = ""
          public shared selectedItem as Integer 
end Class

Open in new window

My question is how to Close or Hide the alist from the user after the selected record is double clicked

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
What type of project/solution are you working with (ASP.NET, Windows Forms, ...)?
KevinfeeningAuthor Commented:
Windows Forms
Bob LearnedCommented:
Where do you get ListPanel from?  That is not a standard Windows Forms control.
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

KevinfeeningAuthor Commented:
as I said bit hard to explain I inherited this project and not sure on the syntax

The original developer created his own controls etc
Bob LearnedCommented:
You should be able to attach an event handler to the control's DoubleClick event handler, if exposes one.  If it doesn't expose one, it should be fairly easy to create one (if the control is home grown).
KevinfeeningAuthor Commented:
the control is home grown how do you create a DoubleClick event handler
Bob LearnedCommented:
Here is a little light reading about events:

Events (Visual Basic)


Public Event MouseDoubleClick As EventHandler

Raise the event:

' Raise the MouseDoubleClick event
Protected Sub OnMouseDoubleClick()
  RaiseEvent MouseDoubleClick(Me, EventArgs.Empty)
End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.