By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 958 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

listview column: clicking via code

P: n/a
I'm trying to fire the ColumnClick event for a Listview control remotely.
Problem is, I'm not sure what parameters to pass.

Here's the sub header for the event:

Private Sub Files_listview_ColumnClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.ColumnClickEventArgs) Handles Files_listview.ColumnClick

I'm *assuming* I can just use the listview control as the sender-- but I
have no idea what to use for e. I've dug through the docs and tried all
sorts of things but I get error messages that are unhelpful.

Now, I could be wrong in what the sender should be (the column itself
perhaps?) but regardless I am clueless on what to send for the
ColumnClickEventArgs and neither leaving the parameter blank nor using the
Nothing keyword are acceptabable.

Any and all help appreciated.

Thanks,

Randall Arnold
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Use the index of the column you want to click:

Dim yourIndex as Integer = 2

Files_listview_ColumnClick(yourlistview, New
ColumnClickEventArgs(yourIndex))
"Randall Arnold" <Ra***********@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
I'm trying to fire the ColumnClick event for a Listview control remotely.
Problem is, I'm not sure what parameters to pass.

Here's the sub header for the event:

Private Sub Files_listview_ColumnClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.ColumnClickEventArgs) Handles
Files_listview.ColumnClick

I'm *assuming* I can just use the listview control as the sender-- but I
have no idea what to use for e. I've dug through the docs and tried all
sorts of things but I get error messages that are unhelpful.

Now, I could be wrong in what the sender should be (the column itself
perhaps?) but regardless I am clueless on what to send for the
ColumnClickEventArgs and neither leaving the parameter blank nor using the
Nothing keyword are acceptabable.

Any and all help appreciated.

Thanks,

Randall Arnold

Nov 21 '05 #2

P: n/a
Beautiful! Worked right off the bat. The only thing I hadn't tried was the
"New" keyword. I didn't think about why I had to at first but I get it now.
Thanks!

Randall

"Some Guy" wrote:
Use the index of the column you want to click:

Dim yourIndex as Integer = 2

Files_listview_ColumnClick(yourlistview, New
ColumnClickEventArgs(yourIndex))
"Randall Arnold" <Ra***********@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
I'm trying to fire the ColumnClick event for a Listview control remotely.
Problem is, I'm not sure what parameters to pass.

Here's the sub header for the event:

Private Sub Files_listview_ColumnClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.ColumnClickEventArgs) Handles
Files_listview.ColumnClick

I'm *assuming* I can just use the listview control as the sender-- but I
have no idea what to use for e. I've dug through the docs and tried all
sorts of things but I get error messages that are unhelpful.

Now, I could be wrong in what the sender should be (the column itself
perhaps?) but regardless I am clueless on what to send for the
ColumnClickEventArgs and neither leaving the parameter blank nor using the
Nothing keyword are acceptabable.

Any and all help appreciated.

Thanks,

Randall Arnold


Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.