Results 1 to 4 of 4

Thread: [RESOLVED] DLL - Making buttons

  1. #1

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    Resolved [RESOLVED] DLL - Making buttons

    Hi guys, I'm making a DLL and I would like to know if it is possible to make a button and then set the parent of the button to another application exe?

    The DLL is for GameMaker and I've got it getting the window handle of the GM exe so then I can set the parent window for the button.

    I've tried stuff like this but it won't work:
    Code:
    Dim b as Button = New Button
    Anyone have any ideas?

    Thanks in advance, knxrb
    Did I help you with your problem? If I did rate me by clicking here: Rate knxrb

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: DLL - Making buttons

    I'm not sure about setting the parent etc but the reason why you can just create a new button in a DLL Class library project is because the Button class lives in System.Windows.Forms and by default that reference is not added to a class library project. Add a reference to System.Windows.Forms and then you can do that (but you will have to either import the System.Windows.Forms namespace at the top of your code or fully qualify the Button class - e.g Dim Button1 As New System.Windows.Forms.Button).

    Hope that helps
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    Re: DLL - Making buttons

    Thanks chris, it's working perfectly now

    knxrb
    Did I help you with your problem? If I did rate me by clicking here: Rate knxrb

  4. #4
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [RESOLVED] DLL - Making buttons

    no worries, glad I could help
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


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