Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2006

Tip: Looking for answers? Try searching our database.

EditValue problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pyda001@ec.auckland.ac.nz - 01 Jul 2006 00:41 GMT
Hi yall!

I have created an image selection dropdown editor for use in a
PropertyGrid. My selector form is called dropdown by a
IWindowsFormsEditorService and so far it's all sweet.

On my selector form I have placed a lot of pictures the user can select
from. I have also placed a button with "From File..." that opens an
OpenFileDialog (Remember that this is still in the dropdown dialog form
of the PropertyGrid). The problem is that when the "From File..."
button is clicked, ShowDialog() is called, the OpenFileDialog opens and
gets focus, and the selector form DISAPPEARS. As a second effect, the
OpenFileDialog stays topmost, yet the application can be used
underneath.

How can I keep the dropdown UITypeEditor visible after the
OpenFileDialog.ShowDialog() call, and yet make both controls disappear
if the user clicks somewhere else on the screen or presses esc?

Thanks!

- Peder -
JJ - 04 Jul 2006 23:05 GMT
Try making the selector form the owner of the OpenFileDialog before calling
ShowDialog.

Good luck
Jeff www.ruamkwamkid.com

> Hi yall!
>
[quoted text clipped - 18 lines]
>
> - Peder -
http://www.bit-kit.com - 05 Jul 2006 01:00 GMT
Nope, that don't work. I suspect the reason is that
IWindowsFormsEditorService somehow strips the selector form for all
events and key variables. This results in that even if the form is set
as the owner of the OpenFileDialog, the editor service unsets it so it
becomes modal with no owner. The selector form is still disposed of,
but without any events firing.

The way I ended up handling it was to keep a static variable to the
bottommost non-mdi form, and setting this as the owner programatically
in ShowDialog(). That way the application is locked until the user
either clicks Ok or Cancel on the OpenFileDialog. It might not be the
cleanest solution I could think of, but it works.

- Peder -

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.