Results 1 to 4 of 4

Thread: Image on a button..(aka: WinCV is a great tool!)

  1. #1

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913

    Image on a button..(aka: WinCV is a great tool!)

    I was working on an app and wanted to add image to one of my buttons. Didnt know how...so I pulled up wincv and looked up the button properties and saw Image....knowing how .NET works I was easily able to guess that all i needed to say was

    btn.Image = new System.Drawing.Bitmap("filename");

    problem ..the image is right on top of the button text...so I looked at WinCV again....button has an ImageAlign property with a value of ContentAlignment...but whats that?

    looked it up once again in WinCV and saw it was part of the System.Drawing namespace and has some enumaration such as TopLeft, TopRight, MiddleLeft, etc.. so I put 2 and 2 together and wrote.

    btn.ImageAlign = ContentAlignment.MiddleLeft;

    and it worked...awesome..

    the moral of this story, use WinCV to learn more about what an an object has to offer and you can often get yourself out of a pickle..especially if you dot use Visual Studio!

    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    Re: Image on a button..(aka: WinCV is a great tool!)

    Originally posted by Cander
    I was working on an app and wanted to add image to one of my buttons. Didnt know how...so I pulled up wincv and looked up the button properties and saw Image....knowing how .NET works I was easily able to guess that all i needed to say was

    btn.Image = new System.Drawing.Bitmap("filename");

    problem ..the image is right on top of the button text...so I looked at WinCV again....button has an ImageAlign property with a value of ContentAlignment...but whats that?

    looked it up once again in WinCV and saw it was part of the System.Drawing namespace and has some enumaration such as TopLeft, TopRight, MiddleLeft, etc.. so I put 2 and 2 together and wrote.

    btn.ImageAlign = ContentAlignment.MiddleLeft;

    and it worked...awesome..

    the moral of this story, use WinCV to learn more about what an an object has to offer and you can often get yourself out of a pickle..especially if you dot use Visual Studio!

    what is and where can we get wincv?

  3. #3

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    it comes with the framework..just run wincv form the command line or Run.. on the start menu.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4
    Hyperactive Member thinktank2's Avatar
    Join Date
    Nov 2001
    Location
    Arctic
    Posts
    272
    WinCV = Windows Class Viewer

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