About usercontrol in .NET

  • Thread starter Thread starter sonu
  • Start date Start date
S

sonu

Hi all,

I have a problem regarding use of a usercontrol in .NET.
My usercontrol consists of two listviews which I say as source and
destination lisviews which
contains the files and folders.
I select files from source view and transfer it to the destination
view.The problem arises while
displaying the dialog for overwriting the file or folder if it is
present on the other side.

The overwrite form which I want to display should be modal. Otherwise
it could delete the
files or folders in the background view. I don't want to use a flag
which will block the deletion
if transfer is going on. The overwriteDialog should not allow me to
shift the focus elsewhere.

The problem is when i display the dialog using
_overwriteFile.showDialog() '_overwriteFile is a object of
OverwriteFile

It is not getting displayed as modal.Remember the parent for the dialog
is a usercontrol.
I have even tried with displaying it by _overwriteFile.showDialog(Me).
But still the problem
persists.

Is it that we cannot display a modal dialog on a usercontrol?

I have also used one third party control of Magiclibrary's docking
manager which is the container for my usercontrol.

Somewhere on the posts I have read that third party controls also play
role while displaying the modal dialogs.If anyone has any idea abt this
control and is there any relevance with the
problem I am facing plz. do reply

Thanks in advance.
Imm. reply needed plz. do reply.
 
There should not be any problems displaying a modal
form from a usercontrol (I just tried it):

Public Class ModalTestUserControl
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim frm As New MyModalForm
frm.ShowDialog()
End Sub
End Class

Form is being displayed modally and behaves as it should.

The only thing you should not do is display a non-modal
form from a modal dialog. Modal from modal or modal from
non-modal should be fine.

I think you need to isolate the problem: Create a new form,
set this form as the startup form in the project properties, then
test an instance of your usercontrol on that form.

Just to find out if the problem is with the usercontrol, rather
than the docking framework or some interaction problems with
the usercontrol and the docking framework.

/JB
 
I have the same issue. The problem is, that the dialog doesn't get hidden
behind the form all the time. Most of the time, it's fine, and it stays on
top. But many times it does get hidden behind the form. So the form is
unusable, because there is an unclosed dialog. But the dialog is not visible
and there is no other way to get to it, other then Alt_Tab and selecting the
application. The the dialog appears.

I haven't been able to figure out a pattern of why this might happen or
when. It just sort of happens sometimes, and I have to figure there is
something going on in the OS, and that is affecting the dialog.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top