Results 1 to 3 of 3

Thread: CreateObject

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Question

    Hi,

    I have this question about CreateObject.

    This is what I use for MSComm. (and it works)

    code:
    Dim C1 as Object
    Set C1 = CreateObject("MSCommLib.MSComm")
    C1.Settings = "9600,n,8,1"
    ....
    Set C1 = Nothing

    I need to know how you do this for a label, textbox, button, frame, ...
    So I need to know the command line,
    like --> "MSCommLib.MSComm", for these objects.

    R@emdonck


  2. #2
    Addicted Member
    Join Date
    May 2000
    Posts
    247

    I think I got this from HeSaidJoe

    Code:
    Private WithEvents btnObj As TextBox
    
    Private Sub Form_Click()
      Set btnObj = Controls.Add("VB.Textbox", "txtText1")
      With btnObj
        .Visible = True
        .Width = 600
        .Height = 300
      End With
    End Sub
    Mako Shark
    Great White

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Lightbulb

    Hi,

    I tried it but it does not work, but ... I forgot to tell you that:

    I am using VBE.

    Sorry ...

    This is the error I get:

    Compile error:
    Object does not source automation events

    R@emdonck


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width