Search In Site

29 June, 2013

Adding HTML Controls To DHTML Pages In Visual Basic

Adding HTML Controls To DHTML Pages
Using the Visual Basic DHTML Page Designer, you can add the standard HTML controls to a Web page: buttons, Submit buttons, Reset buttons, text fields, text areas, password fields, option buttons, checkboxes, select controls, file upload controls, hidden fields, and lists. As you can see, the whole HTML control set is here, and you can use these controls with Visual Basic just as you would in a standard form if you create the DLL file for your DHTML page (see “Creating DHTML Pages” earlier in this chapter), or with a scripting
language such as VBScript or JavaScript.
Adding these controls to your Web page is just like adding them to a standard Visual Basic project. You just use the control’s tool in the Page Designer’s toolbox in the same way you’d use a tool in the Visual Basic toolbox.
The code that the Page Designer adds to our Web page for the Submit button looks like this:
<HTML>
<HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content='"MSHTML 4.72.3007.2"' name=GENERATOR>
</HEAD>
<BODY>
<P>Here’s some text!</P>
<P>Here’s an image:</P>
<P>&nbsp;</P>
<P><IMG id=Image1 name=Image1 src="c:\vbbb\dhtml\image1.bmp" style="LEFT: 40px; POSITION: absolute; TOP: 107px; Z-INDEX: 100">
</P>
<P>&nbsp;</P>
<P>Here’s a Submit button:
<INPUT id=SubmitButton1 name=SubmitButton1 style="LEFT: 17px;
POSITION: absolute; TOP: 170px; Z-INDEX: 103" type=submitvalue=SubmitButton1>
</P>

To add code to the Submit button, you double-click it in the Page Designer just as you would when creating a standard Visual Basic. Doing so adds an event handler procedure to the page’s code:
Private Function SubmitButton1_onclick() As Boolean
End Function

For example, here’s how we display a message box when the user clicks the Submit button:
Private Function SubmitButton1_onclick() As Boolean
MsgBox "You clicked the Submit button!"
End Function

0 comments:

Post a Comment

Dear Visitors All The Tricks And Hacks Posted Here Are Only For Knowledge Purpose.Don't Use These for Illegal Operations.

 
Twitter Bird Gadget