Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2010 > BOOK: Visual Basic 2010 Programmer's Reference
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Visual Basic 2010 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2010 Programmer's Reference by Rod Stephens; ISBN: 9780470499832
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2010 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 22nd, 2011, 07:07 PM
Registered User
 
Join Date: Jul 2011
Location: Wales
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default ListView on MDI child form click event

I have created a project with a series of MDI Child forms to display data in different formats. I cannot find how to detect click events on the list view.

A click event on a ListView on a normal form works fine.

A click event on the mdi child form that has the listview on it works fine.

What I want to do is get the index of the item selected in the listview.

I hope this question makes sense.

I have searched this site and MSDN, I cannot find a solution anywhere.

Thanks

Bob Spencer
Reply With Quote
  #2 (permalink)  
Old July 23rd, 2011, 11:26 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

I'm not completely sure I understand. I can use the ListView's SelectedIndexChanged event to tell when the user clicks on a new item. Note that the event will be called with SelectedIndices empty when it removes the old item from the selection but before it adds the new item to the selection.

I put the control in an MDI child form and it seems to work.

Do you need more than that?

(As an aside, Microsoft seems to provide less support for MDI forms with each release. I don't think their heart is really in MDI.)
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
  #3 (permalink)  
Old July 23rd, 2011, 01:08 PM
Registered User
 
Join Date: Jul 2011
Location: Wales
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default ListView Events on a MDI Child Form

Rod

Thanks for getting back to me, so promptly.

It must be something to do with the way I have set my project up.

With the help of your book I have used AddHandler to detect events, and it works.

At least I can find which Item is selected.

I have bought a new machine and jumped from Windows ME to Vista, and VB3 to VB2010, I quess the learning curve was more like a cliff than a gentle gradient.

I created a sub routine to handle SelectedIndexChanged as you suggested with just a MsgBox in it, but it was never called!

Anyway I have a work round thanks to you.


Bob Spencer.
Reply With Quote
  #4 (permalink)  
Old July 23rd, 2011, 02:36 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Yes, VB 3 to .NET is a pretty big jump.

If you zip up the project and email it to me, I'll take a look. I don't know why it shouldn't work.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying MDI Child Form Menus with MDI Parent ashu_from_india Pro VB 6 3 June 10th, 2008 11:01 PM
Controlling MDI child form from MDI parent panel LuxCoder Pro Visual Basic 2005 1 May 25th, 2007 12:20 PM
Controlling MDI child form from MDI parent panel LuxCoder VB.NET 2002/2003 Basics 7 April 11th, 2007 02:38 PM
Controlling MDI child form from MDI parent panel LuxCoder Visual Basic 2005 Basics 2 April 9th, 2007 03:24 PM
Opening MDI Child on Button Click of MDI Child Sachin Shinde Visual Studio 2005 0 June 8th, 2006 05:05 AM



All times are GMT -4. The time now is 11:11 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.