How To Ideas | How To Articles | How To Tutorials


0

How To Create An Image Button In C#


You can easily embed an image in Button control, which makes your button looks attractive in Windows Form. But note that the image you want to embed into button must be a Resource file. Just follow the instructions and you will be able to create this kind of button for yourself.

Instructions:

  1. Create a Button control on your Windows Form and then open its properties.
  2. In its properties, change the text whatever you want and if you don’t want any text, then delete all the text.
    Change Text On Your Button
  3. Change the font size if the Image you will be applying have a bit large size, because in that case your small sized text will not look good with that image.
    Change Font Size
  4. Now to apply an Image to this Button, select its Image property and then click on ellipsis button to select an image.
    Assign Image To Button
  5. It will open a Select Resource dialogue, where you can select an image which you want to apply to this Button. But if you do not have any image as Resource in your Project, then click on Import button which will open a file selection dialogue. Just select your Image and imports that into your Project. Now your Image will be visible in the Select Resource dialogue. So, select it and click OK.
    Select Image Resource
  6. It will apply that image to your Button. But you will be having your image and text mixed up in the Button like I have in following image.
    Image And Text Mixed Up
  7. So, to separate these two, select the Button and open its Properties. Change the value of Text Image Relation value from overlay to something else which will separate the two things in your Button.
    Align Image With Respect To Text
  8. You can also change Text Align and Image Align properties to align your Text and Image which may also help separating these two and making your Button attractive.

Incoming search terms:

  • how to designa attractive menu in asp net using c# (1)
  • Visual c sharp windows 7 look (1)
Filed in: C# Tags: , , , , , , , ,

Leave a Reply

Submit Comment



© 7078 How To Ideas. All rights reserved.
Proudly designed by Theme Junkie.