dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: How Can put Icon In Button In WPF Technology?

  1. #1
    Join Date
    May 2019
    Location
    601 & 612, The Times square Arcade, Near Baghban party plot, Thaltej - Shilaj Rd, Thaltej, Ahmedabad, Gujarat 380059, India
    Posts
    7

    Post How Can put Icon In Button In WPF Technology?

    Below Snippet Code:

    Code:
    <Button Grid.Column="0" Width="auto" HorizontalAlignment="Right" Margin="0,2,350,2" Opacity="0.8">
    <Image Source="C:\Users\sanjay.vaniya\Desktop\New Design\New Design\img\gamespot_32.png" Width="20" Height="20" Margin="5,2,8,2" Opacity="0.8" VerticalAlignment="Center"/>
    <TextBlock Text="Family And Social History" VerticalAlignment="Center" Margin="0,0,5,0" Width="auto" />

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,060

    Re: How Can put Icon In Button In WPF Technology?

    It's been a long while since I've done any WPF, but I don't think you can load an image by specifying it's file path. Instead, I believe you need to embed the image to reference it. Search bing or Google for "embed an image in wpf". There are quite a few examples out there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)