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. web controls in windows forms

web controls in windows forms

Scheduled Pinned Locked Moved C#
csharpwpfhtmlasp-netwinforms
11 Posts 7 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 Offline
    M Offline
    mjcs100
    wrote on last edited by
    #1

    Is there a way to have a windows form and add web controls to be able to use the bullet style change styles without needing for it to be on the web? I am new to programming and do not know asp.net, html, or WPF to do it one of those ways. Thank you

    L D P P Graeme_GrantG 6 Replies Last reply
    0
    • M mjcs100

      Is there a way to have a windows form and add web controls to be able to use the bullet style change styles without needing for it to be on the web? I am new to programming and do not know asp.net, html, or WPF to do it one of those ways. Thank you

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

      It really depends on what you are actually trying to achiev. Maybe all you need is a RichTextBox Class (System.Windows.Forms) | Microsoft Learn[^].

      1 Reply Last reply
      0
      • M mjcs100

        Is there a way to have a windows form and add web controls to be able to use the bullet style change styles without needing for it to be on the web? I am new to programming and do not know asp.net, html, or WPF to do it one of those ways. Thank you

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        To answer the question "can you use web controls in a Windows forms app?", to keep things simple, no, you can't. As Richard said, if you need to display bulleted data, you can look into a RichTextBox control. If you need to display something else, you're going to have to describe, in detail, what you want to display and in what format.

        Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
        Dave Kreskowiak

        1 Reply Last reply
        0
        • M mjcs100

          Is there a way to have a windows form and add web controls to be able to use the bullet style change styles without needing for it to be on the web? I am new to programming and do not know asp.net, html, or WPF to do it one of those ways. Thank you

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

          Technically, you can, although I would recommend against it. If you need a dynamic website, then you're going to need a webserver somewhere. If, however, your webpage is static, you can simply host a webcontrol in your form and point it at a local index.html file and that would be displayed. Saying that, while you could technically do this; save yourself a lot of pain, and use a RichTextBox instead.

          Advanced TypeScript Programming Projects

          D 1 Reply Last reply
          0
          • M mjcs100

            Is there a way to have a windows form and add web controls to be able to use the bullet style change styles without needing for it to be on the web? I am new to programming and do not know asp.net, html, or WPF to do it one of those ways. Thank you

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

            When refering to a "bullet change Style", maybe you're actually looking for a group of "radio buttons": [RadioButton Control Overview - Windows Forms .NET Framework | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/radiobutton-control-overview-windows-forms?view=netframeworkdesktop-4.8) [RadioButton - WPF .NET Framework | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/radiobutton?view=netframeworkdesktop-4.8)

            "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

            1 Reply Last reply
            0
            • P Pete OHanlon

              Technically, you can, although I would recommend against it. If you need a dynamic website, then you're going to need a webserver somewhere. If, however, your webpage is static, you can simply host a webcontrol in your form and point it at a local index.html file and that would be displayed. Saying that, while you could technically do this; save yourself a lot of pain, and use a RichTextBox instead.

              Advanced TypeScript Programming Projects

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              That's why I said "to keep things simple".

              Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
              Dave Kreskowiak

              1 Reply Last reply
              0
              • M mjcs100

                Is there a way to have a windows form and add web controls to be able to use the bullet style change styles without needing for it to be on the web? I am new to programming and do not know asp.net, html, or WPF to do it one of those ways. Thank you

                P Offline
                P Offline
                pr1mem0ver
                wrote on last edited by
                #7

                I have used a great resource for something similar. It doesn't support everything (such as css) but if you are looking to create html aware forms in Windows.Forms, the HTMLRenderer NuGet packages are perfect (you may be stuck with .NET Framework as the support for .NET Core is questionable). It is also specific to HTML 4.1. I believe it does support bulleted lists as long as you don't mind that you can't use CSS. (It says it can but CSS is only partially implemented so many of its features do not work). EDIT: Here is an image of an example control I made with these packages which make use of bulleted lists: ibb.co/6b4JSJQhtml-control-example [edit]Link made visible (your choice if you follow it, but it seems to be some link shortening image site) : OriginalGriff[/edit]

                OriginalGriffO 1 Reply Last reply
                0
                • P pr1mem0ver

                  I have used a great resource for something similar. It doesn't support everything (such as css) but if you are looking to create html aware forms in Windows.Forms, the HTMLRenderer NuGet packages are perfect (you may be stuck with .NET Framework as the support for .NET Core is questionable). It is also specific to HTML 4.1. I believe it does support bulleted lists as long as you don't mind that you can't use CSS. (It says it can but CSS is only partially implemented so many of its features do not work). EDIT: Here is an image of an example control I made with these packages which make use of bulleted lists: ibb.co/6b4JSJQhtml-control-example [edit]Link made visible (your choice if you follow it, but it seems to be some link shortening image site) : OriginalGriff[/edit]

                  OriginalGriffO Offline
                  OriginalGriffO Offline
                  OriginalGriff
                  wrote on last edited by
                  #8

                  Be careful when posting links (especially links that look like link shorteners) - your original held what is called a "hidden link": no text so the link can't be seen, much less clicked on. Normally, that would have been an open-and-shut moderation, and your account would disappear as a spammer. If you must post image links, then expect two things: lots of moderation and false positive reports against you - particularly when the link looks like yours does and you can't tell what is at the other end. In deference to your length of membership, I spun up a VM to check it, but many will not want to do that and will report your account as spam instead. That will mean you get shown the door ... so it's in your interest not to look suspicious!

                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                  "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                  P 1 Reply Last reply
                  0
                  • OriginalGriffO OriginalGriff

                    Be careful when posting links (especially links that look like link shorteners) - your original held what is called a "hidden link": no text so the link can't be seen, much less clicked on. Normally, that would have been an open-and-shut moderation, and your account would disappear as a spammer. If you must post image links, then expect two things: lots of moderation and false positive reports against you - particularly when the link looks like yours does and you can't tell what is at the other end. In deference to your length of membership, I spun up a VM to check it, but many will not want to do that and will report your account as spam instead. That will mean you get shown the door ... so it's in your interest not to look suspicious!

                    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                    P Offline
                    P Offline
                    pr1mem0ver
                    wrote on last edited by
                    #9

                    Ok... thanks for the heads up. I copied the embedded link provided to me by imgbb, not aware of this issue. I wanted to just embed an image but there doesn't seem to be a direct way to do that. I just wanted to demonstrate the capabilities of the solution I was proposing. The software I showed in the picture isn't even available... (at least not yet), so I am not sure how that could qualify as spam (other than in appearance).

                    OriginalGriffO 1 Reply Last reply
                    0
                    • P pr1mem0ver

                      Ok... thanks for the heads up. I copied the embedded link provided to me by imgbb, not aware of this issue. I wanted to just embed an image but there doesn't seem to be a direct way to do that. I just wanted to demonstrate the capabilities of the solution I was proposing. The software I showed in the picture isn't even available... (at least not yet), so I am not sure how that could qualify as spam (other than in appearance).

                      OriginalGriffO Offline
                      OriginalGriffO Offline
                      OriginalGriff
                      wrote on last edited by
                      #10

                      You can't post images directly, except in a very limited number of (highly policed) forums - this is a SFW site and nobody wants your corporate net nazis to get offended by some of the images that would get posted ... we have visitors that would post some truely offensive images if given the chance ... :~

                      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                      1 Reply Last reply
                      0
                      • M mjcs100

                        Is there a way to have a windows form and add web controls to be able to use the bullet style change styles without needing for it to be on the web? I am new to programming and do not know asp.net, html, or WPF to do it one of those ways. Thank you

                        Graeme_GrantG Offline
                        Graeme_GrantG Offline
                        Graeme_Grant
                        wrote on last edited by
                        #11

                        I've just seen you post, so sorry for the late reply. The answer is yes, you can. Blazor WASM (Web Assembly) enables you to do just that. I have written an article recently that demonstrates this with WPF, however WinForms can do the same. Here is the article: Blazing.Mvvm - Blazor WASM & Blazor Hybrid using the Community Toolkit[^] - ignore the fact that the article focuses on MVVM. The key thing for you, in the article, is not only proof of concept, but also how you can interact with the Blazor part from within your WinForms app and vice versa. IT is made possible by the BlazorWebView control. Microsoft have an article that shows you how to host Blazor within WinForms: Build a Windows Forms Blazor app | Microsoft Learn[^]. Be aware though, to do this, you need to work with .Net 7.0+, not .Net Framework. However, if you need to move from .Net Framework to .Net, then your app will receive an immediate performance boost due to improvements made to .Net - no legacy support.

                        Graeme


                        "I fear not the man who has practiced ten thousand kicks one time, but I fear the man that has practiced one kick ten thousand times!" - Bruce Lee

                        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