Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Using an ActiveX Control in a Web Page. ...
Author:
Gagan Bhargava
E-mail:
Click to e-mail author
Submitted:
10/8/2001
Version:
VB5
Compatibility:
VB5, VB6
Category:
ActiveX
Views:
21260
Using an ActiveX Control in a Web Page.
Declarations:
'none
Code:
I'm briefing you about how to use an Active X Control in a Web page. I hope you know few things about the Web page & an Active X Control. Even if you don't know much then follow this simple instructions. First I'll brief you about how to create a Simple Active X Control and then I'll show you how to embed the control we created in a Web Page. Open Visual Basic Select ActiveX Control A Form (like a Standard Form) opens. This form is just like a Standard Form in Visual Basic. Name your Control as CtlTest and rename the Project to PrjCtlTest. Place a TextBox Control in the Form and set its default Text to "Hello World!!" Now place a Command Button and set the caption as "Show Message" Now code the Command Button as : Private Sub Command1_Click() MsgBox Text1.Text End Sub Save your project and under File menu click on make PrjCtlTest.ocx. This will Register your OCX in the registry. Now in your WebPage add the following Code.
For CLASSID you need to open your Registry(Click on Run and type RegEdit and Press Enter) and from the Edit menu select Find and now search for your project which is PrjCtlTest in this case. A long string will be returned to you. For eg the string will look something like "clsid:63D41E4B-3378-47E8-B1C5-20EA2F5E4ADE". Remember this is a Unique string so this string won't work in your project. You need to have a reference of the string returned by your Registry. After you find your String just place it in the code. Now save and Run the file. Your control will now appear on the webpage. Just click on the Show Message and it will display a Message Box "Hello World !!". I hope I am clear enough to make you understand about whats happening here. If incase I am not then I am open for your suggestions and comments. All The Best !!!
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement