|
-
Oct 26th, 2001, 03:28 PM
#1
Thread Starter
Lively Member
can create an form into a COM (dll) ?
Hi,
I would like to create a com (dll) that, when it will be instantiated to display a form on the screen.
I tried with:
Option Explicit
Dim frmView As VB.TextBox
Public Sub NewDaemon()
Set frmView = New VB.TextBox
With frmView
.Text = "test form"
.Width = 1000
.Height = 1000
.Visible = True
End With
End Sub
When I tri this I receive " Invalid use of NEW"
How can this be done? (ex)
Thank you.
-
Oct 27th, 2001, 11:38 AM
#2
Hyperactive Member
Wrong Understanding...
A TextBox is not a Form, and you can't use it like a Form.
The right way would be:
Add a Form to your COM Component. Name it something like frmCOM.
Add a TextBox on the Form. Name it txtCOM or something.
Then in the NewDaemon Function, do something like as follows:
VB Code:
Public Function NewDaemon()
Dim frm as New frmCOM
frm.txtCOM.Text = "Your Message"
frm.Show vbModal
End Function
It should work the way you want.
Abu Haider
____________________________
100% Data Validation for the MS DataGrid Control. Plus Support for Custom and Foreign Lists, DatePicker and much more...
The DataGridEnhancer
I often point to a place where the problem has been discussed, instead of giving you the code that solves it. This is for good, may be you will understand some day...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|