Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
6.3k views
in .NET FTP by (1.2k points)
Hans-

We are trying to disable the MouseDoubleClick events for the local and remote file lists. Do you know how to do this quickly? Any help you can provide would be greatly appreciated.

12 Answers

0 votes
by (161k points)
No simple way except commenting out this line in the source:

this.fileListView.DoubleClick += new System.EventHandler(this.fileListView_DoubleClick);
0 votes
by (1.2k points)
I am sorry to hear that. If there is no other feasible way to disable the Double Click event is there a way to override it to do something else? If so, how?

Thank you.
0 votes
by (161k points)
Currently, no. We have now made the methods overrideable so from 5.0.6 you will be able to do so. Email us for a pre-release build of the DLL if you would like to try it out.
0 votes
by (1.2k points)
Thank you for the new dll. However, we are still having difficulty overriding the DoubleClick feature for both the local and the remote file list views. Is there something more to it than just creating new events using the properties of the file list views? After selecting the double click feature of the file list view, we created the following method:

protected void ftpLocalFileList1_DoubleClick(object sender, EventArgs e)
{
MessageBox.Show("Local File List Double Click Disabled");
//new functionality here

}

protected void ftpRemoteFileList1_DoubleClick(object sender, EventArgs e)
{
MessageBox.Show("Remote Double Click Disabled");
//new functionality here
}

Thanks,
0 votes
by (161k points)
As per the email, you have to override

protected virtual void fileListView_DoubleClick(object sender, System.EventArgs e)

to remove or modify double click functionality.
0 votes
by (1.2k points)
Thanks Bruce, but how do you do that!
0 votes
by (161k points)
subclass and implement that method
0 votes
by (1.2k points)
Forgive me, Bruce, but I wish you would be a little more helpful in your explanations. Please recognize that I don't have the programming skills you do, and it is for this reason that I have purchased your code and support. Perhaps including a little code in your responses would be possible. Again, I believe we paid for support and, quite frankly, your responses on this matter have been short and rather unhelpful. This may seem like a small matter to you, but it is important to my program.

I created the following subclasses to override the double-click features in both the local and remote file lists:

public class VH2OLocalFileList : FTPLocalFileList
{
protected override void fileListView_DoubleClick(object sender, System.EventArgs e)
{
// do nothing
MessageBox.Show("Local Double Click has been overwritten");
}
}//end class for changing double-click feature

public class VH2ORemoteFileList : FTPRemoteFileList
{
protected override void fileListView_DoubleClick(object sender, System.EventArgs e)
{
// do nothing
MessageBox.Show("Remote Double Click has been overwritten");
}
}//end class for changing double-click feature

Then in my main public class, I have the following methods:

protected void ftpLocalFileList1_DoubleClick(object sender, EventArgs e)
{
VH2OLocalFileList ldc = new VH2OLocalFileList();
ldc.fileListView_DoubleClick(sender, e);
}

protected void ftpRemoteFileList1_DoubleClick(object sender, EventArgs e)
{
VH2ORemoteFileList rdc = new VH2ORemoteFileList();
rdc.fileListView_DoubleClick(sender, e);
}

When I build I am getting an access error. What do you suggest?

Thank you.
0 votes
by (161k points)
Subclassing and overriding fileListView_DoubleClick is actually precisely what is required - and it looks like you've actually done all you need to do with VH2OLocalFileList and VH2ORemoteFileList.

Just remove the code from your main public class (not required), and use your new file list classes exactly like you used the EDT ones.
0 votes
by (1.2k points)
Thank you, Bruce. That worked. However, I realize now that it is a different method that needs to be overwritten. I need to be able to navigate through the FileListViews by double clicking on the folders, but I can't have a file start to upload or download if I double-click on it. Instead, it should do nothing on that event. I now believe the method I need to override is the OnSelectItem, which I tried to do. When I tried, though, I got an error saying that the "LocalDirectory" does not exist in the current context. I am guessing that is so becuase it is probably private. Do you know of a way I can accomplish this or override this method?

Also, what is the difference the pro components and the basic components?

Thank you.

Categories

...