locked
Who knows how this button is generated? RRS feed

  • Question

  • HI everyone,

    Who knows how this button is generated?

    I can't find this type of buton in toolbox。Below buttons are different from the button dragged from the toolbox.

    https://social.msdn.microsoft.com/Forums/getfile/1613347

    Best Regards.

    Thursday, August 6, 2020 9:50 AM

All replies

  • Your link is dead.  Returns "Page Not Found."

    Will you take a screenshot and attach it directly to your post?

    Meanwhile this is a wheel that's already been re-invented a few dozen times. 

    Check out this example from CodeProject


    Before you can learn anything new you have to learn that there's stuff you don't know.


    Thursday, August 6, 2020 4:25 PM
  • https://pasteboard.co/Jlc6ZzX.png

    This is my screenshot
    • Edited by wfnewer Friday, August 7, 2020 2:01 AM
    Friday, August 7, 2020 2:00 AM
  • HI Andrew,

    https://pasteboard.co/Jlc6ZzX.png

    This is my screenshot.Don't know why i can't upload pictures directly to my post.

    Friday, August 7, 2020 2:02 AM
  • Try adding a new image to your Resources (in Project Properties). For example, select PNG format, which allows transparent background. Use Visual Studio or another editor to resize and design it.

    Then see these properties of your button: Image, ImageAlign, TextAlign, TextImageRelation.

    Friday, August 7, 2020 5:05 AM
  • Hi wfnewer,
    According to your screenshot, is it just a small picture on the button? 
    If you just want to create a button similar to a screenshot, you can refer to Viorel_'s suggestion. 
    Here are some relevant codes:

    Image image = Image.FromFile(@"C:\Users\Pictures\home.PNG");
    button1.Image = image;
    button1.ImageAlign = ContentAlignment.TopLeft;
    button1.Text = "Start";


    Best Regards,
    Daniel Zhang


    "Windows Forms General" forum will be migrating to a new home on Microsoft Q&A (Preview)!
    We invite you to post new questions in the "Windows Forms General" forum’s new home on Microsoft Q&A (Preview)!
    For more information, please refer to the sticky post.

    Friday, August 7, 2020 7:59 AM
  • Hi wfnewer,
    Has your problem been solved? If it is resolved, we suggest that you mark it as the answer. So it can help other people who have the same problem find a solution quickly. 
    Best Regards,
    Daniel Zhang


    "Windows Forms General" forum will be migrating to a new home on Microsoft Q&A (Preview)!
    We invite you to post new questions in the "Windows Forms General" forum’s new home on Microsoft Q&A (Preview)!
    For more information, please refer to the sticky post.

    Wednesday, August 12, 2020 9:32 AM
  • Thanks for you reply.

    But this is not what I want, maybe I may be unclear about it and you have misunderstood it.

    Wednesday, August 12, 2020 9:54 AM
  • Thanks for you reply.

    But this is not what I want, maybe I may be unclear about it and you have misunderstood it.

    Not picture in button.

    This is a type of button,see the difference between a normal button and this button:

    In the attribute-->design, the fields are different:


    • Edited by wfnewer Wednesday, August 12, 2020 9:58 AM
    Wednesday, August 12, 2020 9:57 AM
  • It seems that this form is derived from another form, which contains btnstop.

    To confirm this, go to the code file, where you will probably see something like this (in C#):

       . . .

       public partial class FormY : FormX

       . . .

    where FormX contains the buttons “Start” and “Stop”. FormY contains “Choose”.


    Wednesday, August 12, 2020 10:20 AM