473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

About usercontrol in .NET

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.

Dec 27 '05 #1
2 1371

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

On 27 Dec 2005 06:59:24 -0800, "sonu" <so*************@yahoo.com>
wrote:
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.


Dec 27 '05 #2
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.

"Joergen Bech @ post1.tele.dk>" <jbech<NOSPAMNOSPAM> wrote in message
news:33********************************@4ax.com...

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

On 27 Dec 2005 06:59:24 -0800, "sonu" <so*************@yahoo.com>
wrote:
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.

Dec 27 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Tee | last post by:
Hi, I have a base usercontrol with a method (blank method, no code), I have another few usercontrols that will inherit this base usercontrol, but I want to force all the usercontrol that...
1
by: zimzion | last post by:
Hi.. My problem is that the ViewState of UserControl is not consisted when the UserControl is dynamically loaded at PreRender Event. That is, A UserControl is dynamically loaded at PreRender...
2
by: Franky | last post by:
Threre is a Form containing a usercontrol In the form's Load event it references a usercontrol property, say, zz The first showdialog(formx) causes 1 usercontrol_load event 2 form_load event...
10
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi, Trying to create a master page that holds a menu, and the menu switches between pages in the site. 2 problem arrosed: a. When I navigate from page to page (all AJAX Web Forms, with the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.