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. WPF
  4. How do I add more than 1 style to a TextBox?

How do I add more than 1 style to a TextBox?

Scheduled Pinned Locked Moved WPF
wpfquestionwcf
10 Posts 4 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.
  • V Offline
    V Offline
    Vipul Mehta
    wrote on last edited by
    #1

    Hi, I have a MultidataTrigger Condition style thats been implemented to a TextBox [1]. I also have another style which I require to implement on the NameTextBox. How do we implement multiple styles on a Text Box? [1]

    <TextBox x:Name="NameTextBox" Style="{StaticResource requiredFieldValidationTextBoxStyle}" Text="{Binding Path=Name}" Width="100"/>

    Regards, Vipul Mehta

    J P 2 Replies Last reply
    0
    • V Vipul Mehta

      Hi, I have a MultidataTrigger Condition style thats been implemented to a TextBox [1]. I also have another style which I require to implement on the NameTextBox. How do we implement multiple styles on a Text Box? [1]

      <TextBox x:Name="NameTextBox" Style="{StaticResource requiredFieldValidationTextBoxStyle}" Text="{Binding Path=Name}" Width="100"/>

      Regards, Vipul Mehta

      J Offline
      J Offline
      Jammer 0
      wrote on last edited by
      #2

      You can't as far as I know.

      Jammer My Blog | Article(s)

      1 Reply Last reply
      0
      • V Vipul Mehta

        Hi, I have a MultidataTrigger Condition style thats been implemented to a TextBox [1]. I also have another style which I require to implement on the NameTextBox. How do we implement multiple styles on a Text Box? [1]

        <TextBox x:Name="NameTextBox" Style="{StaticResource requiredFieldValidationTextBoxStyle}" Text="{Binding Path=Name}" Width="100"/>

        Regards, Vipul Mehta

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        You have to create a new style - you could always have this style BasedOn the initial style, and then implement the bits you need on top.

        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

        My blog | My articles | MoXAML PowerToys

        L J 2 Replies Last reply
        0
        • P Pete OHanlon

          You have to create a new style - you could always have this style BasedOn the initial style, and then implement the bits you need on top.

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          My blog | My articles | MoXAML PowerToys

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

          Pete is correct here.

          Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | XAML Power Toys Home Page

          Just a grain of sand on the worlds beaches.

          1 Reply Last reply
          0
          • P Pete OHanlon

            You have to create a new style - you could always have this style BasedOn the initial style, and then implement the bits you need on top.

            "WPF has many lovers. It's a veritable porn star!" - Josh Smith

            My blog | My articles | MoXAML PowerToys

            J Offline
            J Offline
            Jammer 0
            wrote on last edited by
            #5

            That's not really using two styles on a control though is it? It's just basing one style on another style as far as I can tell.

            Jammer My Blog | Article(s)

            P 1 Reply Last reply
            0
            • J Jammer 0

              That's not really using two styles on a control though is it? It's just basing one style on another style as far as I can tell.

              Jammer My Blog | Article(s)

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              True - that's why I said you had to create a new style. There's no way round this as you noted earlier.

              "WPF has many lovers. It's a veritable porn star!" - Josh Smith

              My blog | My articles | MoXAML PowerToys

              J 1 Reply Last reply
              0
              • P Pete OHanlon

                True - that's why I said you had to create a new style. There's no way round this as you noted earlier.

                "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                My blog | My articles | MoXAML PowerToys

                J Offline
                J Offline
                Jammer 0
                wrote on last edited by
                #7

                Gotcha ...

                Jammer My Blog | Article(s)

                P 1 Reply Last reply
                0
                • J Jammer 0

                  Gotcha ...

                  Jammer My Blog | Article(s)

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  And to clarify the point, I 5d your answer above. That should make it plain for the OP.

                  "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                  My blog | My articles | MoXAML PowerToys

                  J 1 Reply Last reply
                  0
                  • P Pete OHanlon

                    And to clarify the point, I 5d your answer above. That should make it plain for the OP.

                    "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                    My blog | My articles | MoXAML PowerToys

                    J Offline
                    J Offline
                    Jammer 0
                    wrote on last edited by
                    #9

                    :) I've not actually used the BasedOn approach to a styles yet. Could prove interesting to see how it actually works.

                    Jammer My Blog | Article(s)

                    P 1 Reply Last reply
                    0
                    • J Jammer 0

                      :) I've not actually used the BasedOn approach to a styles yet. Could prove interesting to see how it actually works.

                      Jammer My Blog | Article(s)

                      P Offline
                      P Offline
                      Pete OHanlon
                      wrote on last edited by
                      #10

                      I use it a lot - it's incredibly useful.

                      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                      My blog | My articles | MoXAML PowerToys

                      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