Home
Explore
Tags
Contribute
Home
»
VB.NET
»
GDI+ IN VB.NET
Adding GDI+ Web Controls to a Web Form in VB.NET
Posted in
VB.NET
|
GDI+ IN VB.NET
on
November 05, 2019
Tags:
Web Controls
,
Web Form in GDI+
,
VB.NET
In this article you will learn how to Add Web Controls to a Web Form in GDI+
2418
Visual Studio .NET provides a Web Forms control toolbox that's similar to the Windows control toolbox. We can open the toolbox by selecting the View | Toolbox main menu item. The Web Forms category of the toolbox contains the server-side controls (controls available on the server, for which all processing is done on the server). When a browser requests a control, ASP.NET converts the request into HTML and sends it to the browser. The HTML category contains HTML controls. HTML controls are simple HTML tags which all processing done on the client side. As a result, HTML controls are often faster than server-side controls.
Let's switch the page back to the Design and GridLayout mode and add a button, a text box and an Image control to the page by dragging these controls from the Web Forms toolbox to WebForm1.aspx. We will use the View Image button to view an image. The ImageUrl property of the View Image button represents the image that this control will view.
The page should now look like Figure 12.7 (after your position your controls). As the figure shows, we change the button's text to "View Image" by right-clicking on the Properties menu item, which launches the Properties window.
Writing Code on the Button Click Event Handler
The last step of this tutorial is to add an event handler for the button click event, which will set the ImageUrl property of the Image button. This is similar to adding a control event in a Windows Forms application. You can double-click on the button to add a button click event handler.
Figure 12.7: The WebForm1.aspx design mode after the addition of Web Forms controls
Figure 12.8: Viewing an image in a Image control
Double-clicking on the button adds a Button1_click method to the WebForm1.aspx.cs class which hosts code for the page controls and events. Now we write a line of code that sets the ImageUrl property of the Image control as the text of the TextBox control. The button click event handler code is given in Listing 12.1.
Listing 12.1: The button click event handler
Private Sub Button_Click(ByValobject, ByValsender, ByVal e As System.EventArgs)
Image1.ImageUrl = TextBox1.Text
End Sub
Now compile and run the project. In the text box we type
http://www.c-sharpcorner.com/cslogo101.gif
(or any valid image URL) as the URL name and click the View Image button. The output of the program looks like Figure 12.8.
Now that we have seen how to create a simple Web application using Visual Studio .NET and ASP.NET, in the next section we will move on to GDI+ and shows how to use GDI+ to write graphics Web application.
Conclusion
Hope the article would have helped you how to Add Web Controls to a Web Form in GDI+. Read other articles on GDI+ on the website.
Related Articles
Using ADO.NET Adding Editor and Deleting data in Web Forms inVB.NET
Web Services and ASP.NET in VB.NET
How to Create Interactive Buttons in Vb.net
Cross Page PostBack in ASP.NET
Create ASP .NET Web Application in GDI+ using VB.NET
WPF Grid Using VB.NET
Discovery of Web Services
Remoting over the Web in VB.NET
VB.NET Windows Forms Button Control
Adding Tables and Columns to the Windows Forms DataGrid Control in VB.NET
Categories
ACTIVE DIRECTOTRY IN VB.NET
ALGORITHMS AND VB.NET
ARRAY IN VB.NET
ASP.NET AJAX IN VB.NET
ASP.NET USING VB.NET
ASSEMBLIES IN VB.NET
COM INTEROP IN VB.NET
CRYPTOGRAPHY IN VB.NET
CRYSTAL REPORTS IN VB.NET
DATABASE & DBA
DEPLOYMENT IN VB.NET
DESIGN & ARCHITECTURE
DIRECTX WITH VB.NET
ENTERPRISE DEVELOPMENT
FILE IN VB.NET
GAMES IN VB.NET
GDI+ IN VB.NET
GENERAL
LINQ WITH VB.NET
MOBILE DEV IN VB.NET
MULTITHREADING IN VB.NET
NETWORKIN WITH VB.NET
OFFICE AND VB.NET
PRINTING IN VB.NET
REMOTING IN VB.NET
REPORTS IN VB.NET
SECURITY IN VB.NET
SILVERLIGHT USING VB.NET
Speech in VB.NET
STRING IN VB.NET
TABLET PC
VB.NET ADO.NET
VB.NET ARTICLE
VB.NET EXCEPTION HANDLING
VB.NET FAQ
VB.NET HOW DO I
VB.NET LANGUAGE
VB.NET TUTORIALS
VB.NET WINDOWS SERVICES
VBA
VISUAL BASIC 10
VISUAL BASIC LANGUAGE
WCF WITH VB.NET
WEB CONTROL IN VB.NET
WEB DEV IN VB.NET
WEB FORM WITH VB.NET
WEB SERVICES IN VB.NET
WINDOWS CONTROLS
WINDOWS FORMS IN VB.NET
WORKFLOW IN VB.NET
WPF IN VB.NET
XAML IN VB.NET
XML IN VB.NET
More Articles
Stroke Caps in GDI+ using VB.NET
Basic GDI+ Objects in VB.NET
Transformation in GDI+ in VB.NET
Drawing Images in GDI+ in VB.NET
Working with GDI+ Fonts in VB.NET
GDI+ Pie Chart in VB.NET
Using GDI+ Graphics Paths in VB.NET
Drawing Lines in GDI+ using VB.NET
Printing Text in GDI+ using VB.NET
Designing GUI Applications in GDI+ using VB.NET
Printer Settings in GDI+ and VB.NET
No GDI Calls between GetHdc and ReleaseHdc in VB.NET
GDI Managed Environment in VB.NET
Use GDI+ System Brushes and Pens in VB.NET
Select Method carefully in GDI+ using VB.NET
Use Graphics Paths in GDI+ using VB.NET
SetStyle Method in GDI+ using VB.NET
Overriding the GDI+ OnPaint Method in VB.NET
GDI+ Double Buffering and Flicker-Free Drawing in VB.NET
GDi+ Scope and Type of Variable and Performance in VB.NET
Add GDI+ Paint Event Handler and Controls in VB.NET
Understanding the GDI+ Paint Event in VB.NET
Create ASP .NET Web Application in GDI+ using VB.NET
Working with Text and Strings in VB.NET
GDI+ Transforming Text in VB.NET
GDI+ LinearGradientBrush and PathGradientBrush in VB.NET
Drawing GDI+ Images on the Web in VB.NET
Drawing Simple Graphics in VB.NET
Graphics Web Application in GDI+ usnig VB.NET
Adding GDI+ Web Controls to a Web Form in VB.NET
Customizing Page Settings in GDI+ using VB.NET
DetailsCustom Controlling and Print Controller in VB.NET
Drawing Graphics Shapes in VB.NET
The DocumentName Property and Marginal Printing in VB.NET
Draw 2D graphics line,tringle,ellipse,polygon in VB.NET
Print Dialogs in GDI+ using VB.NET
Printing Graphics in GDI+ using VB.NET
Printing Text in GDI+ using VB.NET
A GDI+ Printer Settings Example in VB.NET
GDI+ Pinting Application in VB.NET
Printer Settings in GDI+ using VB.NET
GDI+ PaperSize Class in VB.NET
Printing in GDI+ using VB.NET
GDI+ Text Transformation in VB.NET
Color Transformation and the Color Matrix in VB.NET
Image Transformation in GDI+ using VB.NET
GDI+ Scaling, Shearing and Rotating Colors in VB.NET
GDI+ Miscellaneous Advanced 2D Topics in VB.NET
Mixed Blending in GDI+ using VB.Net
Compositing Mode and Blending in VB.NET
© 2020 DotNetHeaven. All rights reserved.
TERMS & CONDITIONS
|
CONTACT US
|
REPORT ABUSE