Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. button text to image

button text to image

Scheduled Pinned Locked Moved C#
csharpvisual-studiotutorialquestion
13 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Tichaona J

    Apologies - I should have specified that I am developing a WPF application. There doesn't seem to bean option to add an image, unless I am just missing it....:confused:

    T Offline
    T Offline
    Tichaona J
    wrote on last edited by
    #4

    Apologies - I should have specified that I am developing a WPF application. There doesn't seem to be an option to add an image, unless I am just missing it....Confused

    L R V 3 Replies Last reply
    0
    • R Ravi Bhavnani
      • A button has an image property.
      • A button has a text property.
      • Either or both of those may be specified.
      • You have 4 possibilities.
      • One of which will meet your needs.

      /ravi

      My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

      T Offline
      T Offline
      Tichaona J
      wrote on last edited by
      #5

      Apologies - I should have specified that I am developing a WPF application. There doesn't seem to bean option to add an image, unless I am just missing it....:confused:

      T 1 Reply Last reply
      0
      • T Tichaona J

        Apologies - I should have specified that I am developing a WPF application. There doesn't seem to be an option to add an image, unless I am just missing it....Confused

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #6

        With WPF your options are even greater, if I remember correctly. Take a look at some of the WPF articles here on CodeProject and you are bound to find some samples.

        Just say 'NO' to evaluated arguments for diadic functions! Ash

        1 Reply Last reply
        0
        • L Luc Pattyn

          Tichaona J wrote:

          how do you go about ...

          As always[^]. :|

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

          D Offline
          D Offline
          Dell Simmons
          wrote on last edited by
          #7

          Oh, that is beautiful. Well done. I haven't laughed that hard in quit a while.

          L 1 Reply Last reply
          0
          • D Dell Simmons

            Oh, that is beautiful. Well done. I haven't laughed that hard in quit a while.

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #8

            if you prefer the competition's engine: Bing[^]. :)

            Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

            Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

            1 Reply Last reply
            0
            • T Tichaona J

              Apologies - I should have specified that I am developing a WPF application. There doesn't seem to be an option to add an image, unless I am just missing it....Confused

              R Offline
              R Offline
              Ravi Bhavnani
              wrote on last edited by
              #9

              It's easily done with WPF.  See this[^] code snippet, for example. /ravi

              My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

              1 Reply Last reply
              0
              • T Tichaona J

                Apologies - I should have specified that I am developing a WPF application. There doesn't seem to be an option to add an image, unless I am just missing it....Confused

                V Offline
                V Offline
                V 0
                wrote on last edited by
                #10

                You can place virtually any control inside the button, even a listbox, datagrid or in your case an image. You all add them in the content property. In this case better specify the Content as an element instead of an attribute. see MSDN for more details

                V.

                R 1 Reply Last reply
                0
                • V V 0

                  You can place virtually any control inside the button, even a listbox, datagrid or in your case an image. You all add them in the content property. In this case better specify the Content as an element instead of an attribute. see MSDN for more details

                  V.

                  R Offline
                  R Offline
                  Roger Wright
                  wrote on last edited by
                  #11

                  V. wrote:

                  even a listbox, datagrid

                  Now that would look positively weird. But who knows? It might be useful in some odd application...

                  Will Rogers never met me.

                  V 1 Reply Last reply
                  0
                  • L Luc Pattyn

                    Tichaona J wrote:

                    how do you go about ...

                    As always[^]. :|

                    Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                    Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                    N Offline
                    N Offline
                    n podbielski
                    wrote on last edited by
                    #12

                    Oh :) That was good one!

                    In soviet Russia code debugs You!

                    1 Reply Last reply
                    0
                    • R Roger Wright

                      V. wrote:

                      even a listbox, datagrid

                      Now that would look positively weird. But who knows? It might be useful in some odd application...

                      Will Rogers never met me.

                      V Offline
                      V Offline
                      V 0
                      wrote on last edited by
                      #13

                      i did it to practice wpf, but wouldn't use it in real life though.

                      V.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups