In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "how to use VB.NET dialog box", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use VB.NET dialog box" this article.
Overview of VB.NET dialog invocation:
We all know that it is easy to call a dialog box to open a file in .NET, and you can use it directly by defining an instance of the OpenFileDialog class. Sometimes we need to let the user choose a working directory or a system directory, so we are searching for similar OpenDirectoryDialog classes. Of course * has one, which is very convenient. In fact, the system does not provide such a class, let's use very short code to build this directory browsing dialog box.
VB.NET dialog invocation ideas:
In the reference to the project, you will find that there is a System.Designer.dll. By default, this dll is not referenced by the project, and we will introduce it to the project today. Under the name control System.Windows.Forms.Design, there is a FolderNameEditor class, which is actually a directory browsing dialog box, but this class cannot be used directly, it must be Inherit. Look at the following code:
To modularize, we create a new class in the project, named OpenDirectoryDialog, and enter code similar to the following:
The VB.NET dialog calls the code:
Imports System.Windows.Forms Public Class FolderBrowserClass FolderBrowser Inherits System.Windows.Forms. The title fb.Description = "Select a Directory to Scan" of the Design.FolderNameEditor Public Shared Function ShowDialog () Function ShowDialog () As String Dim fb As New FolderBrowser () 'dialog box defaults to the system's desktop directory fb.StartLocation = Design.Folder NameEditor.FolderBrowserFolder.Desktop' dialog box style fb.Style = Design.FolderNameEditor. FolderBrowserStyles.ShowTextBox fb.ShowDialog () Return fb.DirectoryPath End Function End Class
Once compiled, we can use this Class directly.
The call to the VB.NET dialog box is as follows:
Debug.WriteLine (Open DirectoryDialog. ShowDialog () above is all the contents of the article "how to use VB.NET Dialog Box". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.