473,659 Members | 2,965 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET 2005 DialogResult.OK ?

I'm opening my own form and doing something like:

If dlgDirectory.Sh owDialog() = DialogResult.OK Then
....
End If

When I compile the project, I can a warning for the line saying:

Access of shared member, constant member, enum member or nested type through
an instance; qualifying expression will not be evaluated.

It looks like it has something to do with DialogResult.OK , however I've seen
other code do the same thing.

What am I doing wrong?

Dec 13 '05 #1
2 7543
"dm1608" <dm****@spam.ne t> schrieb:
If dlgDirectory.Sh owDialog() = DialogResult.OK Then
...
End If

When I compile the project, I can a warning for the line saying:

Access of shared member, constant member, enum member or nested type
through an instance; qualifying expression will not be evaluated.


There is a name clash between the form's 'DialogResult' property and the
'DialogResult' type, and the compiler will bind to the property instead of
the type. To solve the problem, qualify the type name:

\\\
If d.ShowDialog() = System.Windows. Forms.DialogRes ult.OK Then
...
End If
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 13 '05 #2
"dm1608" <dm****@spam.ne t> schrieb
I'm opening my own form and doing something like:

If dlgDirectory.Sh owDialog() = DialogResult.OK Then
...
End If

When I compile the project, I can a warning for the line saying:

Access of shared member, constant member, enum member or nested type
through an instance; qualifying expression will not be evaluated.

It looks like it has something to do with DialogResult.OK , however
I've seen other code do the same thing.

What am I doing wrong?

Dialogresult is not only a type but also a property of the Form. Use the
FQN:

System.Windows. Forms.DialogRes ult.OK
Armin

Dec 13 '05 #3

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

Similar topics

5
3696
by: Daniel | last post by:
what do you have to do in a C# dialog so that it returns to ShowDialog as DialogResult.OK ?
7
2642
by: Frank Maxey | last post by:
I am fairly new to VB.Net and am having a curious problem. I have an entry dialog form called from a main form. The calling form needs to check the DialogResult field for an OK response. In my button service in the dialog form, I have: Private Sub btnSave_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnSave.Click
6
1277
by: Brian Shafer | last post by:
Hello, I am VERY new to .Net and C#. But I have an app that I bought from a vendor with the source. This was written in C#2003. I have VS2005. I went through the upgrade process.. I have a problem, I am not sure what it is or what to do. But I think it has something to do with a dialog box. The app had a toolbar with buttons on it, on some of the button a dialog box is suppose to popup and give the user a selection of items to view....
11
3008
by: Grumpy Aero Guy | last post by:
I have created an app that makes use of the FolderBrowserDialog. Upon building the app, installing and running it, and invoking the form using the dialog, it hangs upon folder selection and goes "not responding" Upon debugging, it hangs as well upon executing the line that extracts the selected folder without further explanation. All looks well in the debugger prior to executing the line marked with <<<<<< below. When I step over that...
0
1127
by: lgbjr | last post by:
Hi All, I thought this was going to be a simple task, but I just can't get this to work: I need to transfer a file from a client machine to a server using a windows app created with VB.Net 2005. This task led me to My.Computer.Network.UploadFile. The user clicks a button, which opens an OpenFileDialog. They select a file
1
2354
by: Bill Cart | last post by:
I am trying to work with 2 forms. If I set the ModalResult of a button on the 2nd form it works OK. If I try to assign the result and then return it does not return the value I set. 1st Form (calling form) DeliveryInfo DeliveryFrm = new DeliveryInfo(Convert.ToInt32(this.uniqueIDTextBox.Text)); DialogResult result;
5
941
by: cj | last post by:
The below line gives me an error on DialogResult.No saying: "Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated." It didn't give me that in 2003. What does that mean? If MessageBox.Show("Copy from " & fromDir & " to " & toDir & " ?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.No Then
2
6981
by: WP | last post by:
Hello, I making and Windows Forms program and I have a dialog with two buttons. I have set the DialogResult property for these buttons to DialogResult.OK and DialogResult.No, respectively (however, these buttons are not labelled "OK" and "No"). Settting this property is very convenient, I don't need to write any code determining what should happen when one of these buttons is clicked. Anyway, now I need to add a third button and I guess I...
5
4979
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
I am showing a form by ShowModal(). I put a button on that form. When a user clicks the button a MsgBox will show with question "do you want to close?" yes/no. How to handle the situation: - user clicks "yes" - the form closes - user clicks "no" - nothing happens I have problem with that. It seems that assigning property of button.DialogResult wokrs ok only for the first time (in designer generated code and any longer)
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.