Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

Need advice on events

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill Gower - 07 Feb 2007 03:29 GMT
I have 2 listboxes side by side where the user can move an item from left to
right or vice versa by double clicking the item or clicking on a button(s)
between the two listboxes.  I want to enable to disable the move left or
move right buttons as determined by the number of items in the listbox.

Example.  I have no items in the right hand list box so I don't want the
move left button to be enabled.  As soon as an item is moved to the right
hand listbox then I would like the return button to be enabled.  As the
MoveListItem can be called in several ways, I am trying to think of a clean
way to enable or disable without duplicating the code.

What is the best way to do this?

Bill
Michael C - 07 Feb 2007 06:16 GMT
>I have 2 listboxes side by side where the user can move an item from left
>to right or vice versa by double clicking the item or clicking on a
[quoted text clipped - 9 lines]
>
> What is the best way to do this?

Put the code in a function and call it from whereever is required.

> Bill
RobinS - 07 Feb 2007 07:00 GMT
Put it in the click event when you move from one listbox to the other.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
>I have 2 listboxes side by side where the user can move an item from left
>to right or vice versa by double clicking the item or clicking on a
[quoted text clipped - 11 lines]
>
> Bill

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.