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. Including WPF Components

Including WPF Components

Scheduled Pinned Locked Moved C#
csharpwpfquestion
13 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.
  • M Muammar

    I used to do it but now I completely forgot :-O So, how do you include say a StackPanel in your C# Windows Application form?? Many thanks:rose:


    All generalizations are wrong, including this one! (\ /) (O.o) (><)

    J Offline
    J Offline
    jamie550
    wrote on last edited by
    #2

    Put it inside a ElementHost control.

    M 1 Reply Last reply
    0
    • J jamie550

      Put it inside a ElementHost control.

      M Offline
      M Offline
      Muammar
      wrote on last edited by
      #3

      jamie550 wrote:

      Put it inside a ElementHost control.

      What, how where :-O Please clarify :-O


      All generalizations are wrong, including this one! (\ /) (O.o) (><)

      J 1 Reply Last reply
      0
      • M Muammar

        jamie550 wrote:

        Put it inside a ElementHost control.

        What, how where :-O Please clarify :-O


        All generalizations are wrong, including this one! (\ /) (O.o) (><)

        J Offline
        J Offline
        jamie550
        wrote on last edited by
        #4

        Put a ElementHost on your form. If it is called host, then you would do: StackPanel s=new StackPanel(); host.Child=s; s.Children.Add( first control you want); s.Children.Add( second control); etc...

        M 1 Reply Last reply
        0
        • J jamie550

          Put a ElementHost on your form. If it is called host, then you would do: StackPanel s=new StackPanel(); host.Child=s; s.Children.Add( first control you want); s.Children.Add( second control); etc...

          M Offline
          M Offline
          Muammar
          wrote on last edited by
          #5

          Sorry but doh! :doh: :-O What are all these?? Where can I find this mighty ElementHost, what is it?? is it a control?? and how can I access those wpf controls by simply type their names?? I cant just type StackPanel, do I need to reference some class/interface first?? what is it?? Hey, thanks mate!


          All generalizations are wrong, including this one! (\ /) (O.o) (><)

          J 1 Reply Last reply
          0
          • M Muammar

            Sorry but doh! :doh: :-O What are all these?? Where can I find this mighty ElementHost, what is it?? is it a control?? and how can I access those wpf controls by simply type their names?? I cant just type StackPanel, do I need to reference some class/interface first?? what is it?? Hey, thanks mate!


            All generalizations are wrong, including this one! (\ /) (O.o) (><)

            J Offline
            J Offline
            jamie550
            wrote on last edited by
            #6

            The ElementHost is a control. It it located in WindowsFormIntegration.dll StackPanel and most other WPF controls are in PresentationFramework.dll, but you also need PresentationCore.dll and WindowsBase.dll

            M 1 Reply Last reply
            0
            • J jamie550

              The ElementHost is a control. It it located in WindowsFormIntegration.dll StackPanel and most other WPF controls are in PresentationFramework.dll, but you also need PresentationCore.dll and WindowsBase.dll

              M Offline
              M Offline
              Muammar
              wrote on last edited by
              #7

              Thanx jamie but all the dlls you just mentioned are disabled and cant be imported:( What do I do now :sigh:


              All generalizations are wrong, including this one! (\ /) (O.o) (><)

              J E 2 Replies Last reply
              0
              • M Muammar

                I used to do it but now I completely forgot :-O So, how do you include say a StackPanel in your C# Windows Application form?? Many thanks:rose:


                All generalizations are wrong, including this one! (\ /) (O.o) (><)

                M Offline
                M Offline
                Muammar
                wrote on last edited by
                #8

                I hope the idiot who's voting my every post down in this thread knows the answer to my question!!


                All generalizations are wrong, including this one! (\ /) (O.o) (><)

                1 Reply Last reply
                0
                • M Muammar

                  Thanx jamie but all the dlls you just mentioned are disabled and cant be imported:( What do I do now :sigh:


                  All generalizations are wrong, including this one! (\ /) (O.o) (><)

                  J Offline
                  J Offline
                  jamie550
                  wrote on last edited by
                  #9

                  Are you targeting at least .NET Framework 3.0? There should be a tooltip describing the problem.

                  M M 2 Replies Last reply
                  0
                  • M Muammar

                    Thanx jamie but all the dlls you just mentioned are disabled and cant be imported:( What do I do now :sigh:


                    All generalizations are wrong, including this one! (\ /) (O.o) (><)

                    E Offline
                    E Offline
                    erfi
                    wrote on last edited by
                    #10

                    ElementHost class is supported in .net faramework 3.5, 3.0 sp1, 3.0 here is the msdn link about this class : http://msdn.microsoft.com/en-us/library/system.windows.forms.integration.elementhost.aspx[^]

                    sometimes 0 can be 1

                    M 1 Reply Last reply
                    0
                    • J jamie550

                      Are you targeting at least .NET Framework 3.0? There should be a tooltip describing the problem.

                      M Offline
                      M Offline
                      Muammar
                      wrote on last edited by
                      #11

                      Hey jamie, Thanks buddy, I'm fine now:) Thanks for staying with me 'till the end, your great man:)


                      All generalizations are wrong, including this one! (\ /) (O.o) (><)

                      1 Reply Last reply
                      0
                      • E erfi

                        ElementHost class is supported in .net faramework 3.5, 3.0 sp1, 3.0 here is the msdn link about this class : http://msdn.microsoft.com/en-us/library/system.windows.forms.integration.elementhost.aspx[^]

                        sometimes 0 can be 1

                        M Offline
                        M Offline
                        Muammar
                        wrote on last edited by
                        #12

                        Hey erfi, Thanks, I'm fine now:)


                        All generalizations are wrong, including this one! (\ /) (O.o) (><)

                        1 Reply Last reply
                        0
                        • J jamie550

                          Are you targeting at least .NET Framework 3.0? There should be a tooltip describing the problem.

                          M Offline
                          M Offline
                          Mycroft Holmes
                          wrote on last edited by
                          #13

                          You're patience is astonishing, and pleased he thanked you for you effort.

                          Never underestimate the power of human stupidity RAH

                          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