CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2001
    Posts
    16

    Control = Object - How?

    Hi All,

    Situation:
    I have a Form1 with TextBox1 (from MS Forms 2.0) on it.
    I have variable called 'obj' type is Object.
    Value of variable is Textbox.Object

    Question:
    How can I do something like this:

    set TextBox1.Object = obj




    If I write like above I got "Type Mismatch" error.

    Thanks.


  2. #2
    Join Date
    Aug 2001
    Posts
    19

    Don't know exactly what you want, but...

    Your textbox is already a control.
    So you can't write something like text1.object

    Maybe this helps:

    Private Sub Form_Load()

    Dim obj As Object

    Set obj = Text1
    'Now you can do something like obj.text = ""

    End Sub

    Maybe if you explain what you want to do, I or somebody else can give you better information.


  3. #3
    Join Date
    Sep 2001
    Posts
    16

    Re: Don't know exactly what you want, but...

    I already have 'obj' object variable, with contains TextBox.Object

    Q: How can I do: Set TextBox1 = obj?


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

Featured