Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How VB.NET creates controls

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to create VB.NET controls, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

When creating a new VB.NET project, you have the following options: class libraries: a set of class libraries without GUI, similar to bean in java. Some common modules are written to the class library, which is a good way to use them in a project. Can be used in windows app or web app or more projects.

You only need to add the dll of the corresponding class library to the reference, and you can refer to it by referring to the name of the class. If there is a namespace in the class library, imports the namespace at the beginning. You can also use only the class name when calling.

Windows control library: a control built for window app, with GUI.

When in use, select add or remove items in the user control bar on the left toolbar. Select the dll of the VB.NET control. At this point, the control is added to the panel and can be placed into the form like a normal control. When using it, you should also add the corresponding dll to the reference. Because even if you do the * step operation, you can only add the control, and when defining the VB.NET control class, you cannot find the corresponding class.

Web control library: there are no tests, I think it's just a GUI control that can be used in WEB app. The method should be similar to that of the windows control

Asp.net eb service: when you create a web service, you create a virtual directory in iis, just like web app. When the service is established, the reference is based on the newly created web directory (http://localhost.....) To make a reference to the

The web service file is a file that ends in .asmx and the code file is in .asmx.vb. It also operates like a class library, and the code is written in the class. The method to be published as web service is just preceded by _

Public Function

HelloWorld () As String

Return "Hello World"

End Function

When browsing the http://localhost/WebService1/Service1.asmx, the list displays the published service. And have a more detailed explanation of the operation.

The method of use is as follows:

Establish WEB app or window app and so on. Add a web reference to the reference. At this point, you can select a URL; of web service to add the corresponding WEB,URL, such as http://localhost/WebService1/Service1.asmx.

Webservice can be referenced by reference name and class name in the code.

If the reference class named localhost webservice is service1, the reference method is:

Dim aa As localhost.Service1 aa = New localhost.Service1 above is all the content of the article "how to create controls in VB.NET". 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report