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. The Lounge
  3. I have been going round and round in circles all afternoon...

I have been going round and round in circles all afternoon...

Scheduled Pinned Locked Moved The Lounge
helploungecsharpvisual-studiocom
13 Posts 12 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.
  • OriginalGriffO OriginalGriff

    ...all I want to do is create a base class form, and derive a bunch of others from it - the idea being to have a base which has the "general layout" and a bunch of buttons that will be on all forms. And the first problem is that you can't use a static ImageList for all the buttons. And an Imagelist is the only way to use my .ICO file as button images. After going round that for a while (including a perfect looking article here: Sharing and inheriting ImageLists across multiple forms and controls[^] which sounds perfect but doesn't work with VS2019 and I'd had enough of trying by then) I relent and find an online resource that extracts PNG images form Icons. Except they are all too big at 256x256 and the ICO files don't have the right 64x64 images, just 256x256 and 48x48 and smaller. :sigh: OK ... Corel Paintshop Pro has a batch mode ... finally get that working, import the PNG files, apply, presto! Base form is working. Derive a new form. try to view it in the designer ... "Object reference not set to an instance". Find the reason, add the necessary "if design mode", try again. "System.Windows.Forms.Design.IEventHandlerService already exists in the service container. Parameter name: serviceType" :doh: Finally fix it: change the derived form type to "Form", build, view in the designer. Hurrah! No error (or buttons but hey!). Change it back to Base Form. Build. View in the designer. And it works. Sodding Visual Studio. And it's only Tuesday. I am sooooo glad I didn't make the base form abstract ... I'll do that when its' all working. Deriving a concrete class from an abstract UserControl[^] applies to Forms as well.

    "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!

    S Offline
    S Offline
    stoneyowl2
    wrote on last edited by
    #3

    Not meaning to pick nits, but doesn't 'going round and round' imply circles :-O :laugh:

    Thar's only two possibilities: Thar is life out there in the universe which is smarter than we are, or we're the most intelligent life in the universe. Either way, it's a mighty sobering thought. (Porkypine - via Walt Kelly)

    Y 1 Reply Last reply
    0
    • OriginalGriffO OriginalGriff

      ...all I want to do is create a base class form, and derive a bunch of others from it - the idea being to have a base which has the "general layout" and a bunch of buttons that will be on all forms. And the first problem is that you can't use a static ImageList for all the buttons. And an Imagelist is the only way to use my .ICO file as button images. After going round that for a while (including a perfect looking article here: Sharing and inheriting ImageLists across multiple forms and controls[^] which sounds perfect but doesn't work with VS2019 and I'd had enough of trying by then) I relent and find an online resource that extracts PNG images form Icons. Except they are all too big at 256x256 and the ICO files don't have the right 64x64 images, just 256x256 and 48x48 and smaller. :sigh: OK ... Corel Paintshop Pro has a batch mode ... finally get that working, import the PNG files, apply, presto! Base form is working. Derive a new form. try to view it in the designer ... "Object reference not set to an instance". Find the reason, add the necessary "if design mode", try again. "System.Windows.Forms.Design.IEventHandlerService already exists in the service container. Parameter name: serviceType" :doh: Finally fix it: change the derived form type to "Form", build, view in the designer. Hurrah! No error (or buttons but hey!). Change it back to Base Form. Build. View in the designer. And it works. Sodding Visual Studio. And it's only Tuesday. I am sooooo glad I didn't make the base form abstract ... I'll do that when its' all working. Deriving a concrete class from an abstract UserControl[^] applies to Forms as well.

      "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!

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #4

      May I recommend Axialis Icon Workshop. It can convert icons to all of the different graphics formats in all of the different sizes. I have no connection to the company.

      The difficult we do right away... ...the impossible takes slightly longer.

      1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        ...all I want to do is create a base class form, and derive a bunch of others from it - the idea being to have a base which has the "general layout" and a bunch of buttons that will be on all forms. And the first problem is that you can't use a static ImageList for all the buttons. And an Imagelist is the only way to use my .ICO file as button images. After going round that for a while (including a perfect looking article here: Sharing and inheriting ImageLists across multiple forms and controls[^] which sounds perfect but doesn't work with VS2019 and I'd had enough of trying by then) I relent and find an online resource that extracts PNG images form Icons. Except they are all too big at 256x256 and the ICO files don't have the right 64x64 images, just 256x256 and 48x48 and smaller. :sigh: OK ... Corel Paintshop Pro has a batch mode ... finally get that working, import the PNG files, apply, presto! Base form is working. Derive a new form. try to view it in the designer ... "Object reference not set to an instance". Find the reason, add the necessary "if design mode", try again. "System.Windows.Forms.Design.IEventHandlerService already exists in the service container. Parameter name: serviceType" :doh: Finally fix it: change the derived form type to "Form", build, view in the designer. Hurrah! No error (or buttons but hey!). Change it back to Base Form. Build. View in the designer. And it works. Sodding Visual Studio. And it's only Tuesday. I am sooooo glad I didn't make the base form abstract ... I'll do that when its' all working. Deriving a concrete class from an abstract UserControl[^] applies to Forms as well.

        "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!

        R Offline
        R Offline
        RickZeeland
        wrote on last edited by
        #5

        Some fitting music: Sugababes - Round Round - YouTube[^] :-\

        1 Reply Last reply
        0
        • OriginalGriffO OriginalGriff

          ...all I want to do is create a base class form, and derive a bunch of others from it - the idea being to have a base which has the "general layout" and a bunch of buttons that will be on all forms. And the first problem is that you can't use a static ImageList for all the buttons. And an Imagelist is the only way to use my .ICO file as button images. After going round that for a while (including a perfect looking article here: Sharing and inheriting ImageLists across multiple forms and controls[^] which sounds perfect but doesn't work with VS2019 and I'd had enough of trying by then) I relent and find an online resource that extracts PNG images form Icons. Except they are all too big at 256x256 and the ICO files don't have the right 64x64 images, just 256x256 and 48x48 and smaller. :sigh: OK ... Corel Paintshop Pro has a batch mode ... finally get that working, import the PNG files, apply, presto! Base form is working. Derive a new form. try to view it in the designer ... "Object reference not set to an instance". Find the reason, add the necessary "if design mode", try again. "System.Windows.Forms.Design.IEventHandlerService already exists in the service container. Parameter name: serviceType" :doh: Finally fix it: change the derived form type to "Form", build, view in the designer. Hurrah! No error (or buttons but hey!). Change it back to Base Form. Build. View in the designer. And it works. Sodding Visual Studio. And it's only Tuesday. I am sooooo glad I didn't make the base form abstract ... I'll do that when its' all working. Deriving a concrete class from an abstract UserControl[^] applies to Forms as well.

          "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!

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

          More fitting music, RATT - Round And Round[^]. :)

          "the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle

          1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            ...all I want to do is create a base class form, and derive a bunch of others from it - the idea being to have a base which has the "general layout" and a bunch of buttons that will be on all forms. And the first problem is that you can't use a static ImageList for all the buttons. And an Imagelist is the only way to use my .ICO file as button images. After going round that for a while (including a perfect looking article here: Sharing and inheriting ImageLists across multiple forms and controls[^] which sounds perfect but doesn't work with VS2019 and I'd had enough of trying by then) I relent and find an online resource that extracts PNG images form Icons. Except they are all too big at 256x256 and the ICO files don't have the right 64x64 images, just 256x256 and 48x48 and smaller. :sigh: OK ... Corel Paintshop Pro has a batch mode ... finally get that working, import the PNG files, apply, presto! Base form is working. Derive a new form. try to view it in the designer ... "Object reference not set to an instance". Find the reason, add the necessary "if design mode", try again. "System.Windows.Forms.Design.IEventHandlerService already exists in the service container. Parameter name: serviceType" :doh: Finally fix it: change the derived form type to "Form", build, view in the designer. Hurrah! No error (or buttons but hey!). Change it back to Base Form. Build. View in the designer. And it works. Sodding Visual Studio. And it's only Tuesday. I am sooooo glad I didn't make the base form abstract ... I'll do that when its' all working. Deriving a concrete class from an abstract UserControl[^] applies to Forms as well.

            "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!

            D Offline
            D Offline
            DerekT P
            wrote on last edited by
            #7

            OriginalGriff wrote:

            extracts PNG images form Icons

            ... or just use Paint, Resize, SaveAs .png

            OriginalGriffO 1 Reply Last reply
            0
            • D DerekT P

              OriginalGriff wrote:

              extracts PNG images form Icons

              ... or just use Paint, Resize, SaveAs .png

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

              All 93 of them ... I did consider it, but I wanted an "automated" solution to prevent RSI :laugh:

              "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

              M 1 Reply Last reply
              0
              • OriginalGriffO OriginalGriff

                ...all I want to do is create a base class form, and derive a bunch of others from it - the idea being to have a base which has the "general layout" and a bunch of buttons that will be on all forms. And the first problem is that you can't use a static ImageList for all the buttons. And an Imagelist is the only way to use my .ICO file as button images. After going round that for a while (including a perfect looking article here: Sharing and inheriting ImageLists across multiple forms and controls[^] which sounds perfect but doesn't work with VS2019 and I'd had enough of trying by then) I relent and find an online resource that extracts PNG images form Icons. Except they are all too big at 256x256 and the ICO files don't have the right 64x64 images, just 256x256 and 48x48 and smaller. :sigh: OK ... Corel Paintshop Pro has a batch mode ... finally get that working, import the PNG files, apply, presto! Base form is working. Derive a new form. try to view it in the designer ... "Object reference not set to an instance". Find the reason, add the necessary "if design mode", try again. "System.Windows.Forms.Design.IEventHandlerService already exists in the service container. Parameter name: serviceType" :doh: Finally fix it: change the derived form type to "Form", build, view in the designer. Hurrah! No error (or buttons but hey!). Change it back to Base Form. Build. View in the designer. And it works. Sodding Visual Studio. And it's only Tuesday. I am sooooo glad I didn't make the base form abstract ... I'll do that when its' all working. Deriving a concrete class from an abstract UserControl[^] applies to Forms as well.

                "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!

                M Offline
                M Offline
                Matias Lopez
                wrote on last edited by
                #9

                Too much time to waste in images/icons! :laugh:

                1 Reply Last reply
                0
                • S stoneyowl2

                  Not meaning to pick nits, but doesn't 'going round and round' imply circles :-O :laugh:

                  Thar's only two possibilities: Thar is life out there in the universe which is smarter than we are, or we're the most intelligent life in the universe. Either way, it's a mighty sobering thought. (Porkypine - via Walt Kelly)

                  Y Offline
                  Y Offline
                  yacCarsten
                  wrote on last edited by
                  #10

                  Not meaning to nit pick, but the Earth goes round and round in an elliptical orbit ;P

                  // TODO: Insert something here

                  Top ten reasons why I'm lazy 1.

                  1 Reply Last reply
                  0
                  • OriginalGriffO OriginalGriff

                    ...all I want to do is create a base class form, and derive a bunch of others from it - the idea being to have a base which has the "general layout" and a bunch of buttons that will be on all forms. And the first problem is that you can't use a static ImageList for all the buttons. And an Imagelist is the only way to use my .ICO file as button images. After going round that for a while (including a perfect looking article here: Sharing and inheriting ImageLists across multiple forms and controls[^] which sounds perfect but doesn't work with VS2019 and I'd had enough of trying by then) I relent and find an online resource that extracts PNG images form Icons. Except they are all too big at 256x256 and the ICO files don't have the right 64x64 images, just 256x256 and 48x48 and smaller. :sigh: OK ... Corel Paintshop Pro has a batch mode ... finally get that working, import the PNG files, apply, presto! Base form is working. Derive a new form. try to view it in the designer ... "Object reference not set to an instance". Find the reason, add the necessary "if design mode", try again. "System.Windows.Forms.Design.IEventHandlerService already exists in the service container. Parameter name: serviceType" :doh: Finally fix it: change the derived form type to "Form", build, view in the designer. Hurrah! No error (or buttons but hey!). Change it back to Base Form. Build. View in the designer. And it works. Sodding Visual Studio. And it's only Tuesday. I am sooooo glad I didn't make the base form abstract ... I'll do that when its' all working. Deriving a concrete class from an abstract UserControl[^] applies to Forms as well.

                    "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!

                    B Offline
                    B Offline
                    Brisingr Aerowing
                    wrote on last edited by
                    #11

                    What framework version are you using? The .NET Core / 5 WinForms designer doesn’t work correctly with custom control designers. You’ll need to multitarget to a regular framework version (e.g. 4.8) for the designers to work.

                    What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

                    1 Reply Last reply
                    0
                    • OriginalGriffO OriginalGriff

                      All 93 of them ... I did consider it, but I wanted an "automated" solution to prevent RSI :laugh:

                      "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!

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

                      For those who can't (or won't) afford PSP, IrfanView has a nifty batch converter.

                      1 Reply Last reply
                      0
                      • OriginalGriffO OriginalGriff

                        ...all I want to do is create a base class form, and derive a bunch of others from it - the idea being to have a base which has the "general layout" and a bunch of buttons that will be on all forms. And the first problem is that you can't use a static ImageList for all the buttons. And an Imagelist is the only way to use my .ICO file as button images. After going round that for a while (including a perfect looking article here: Sharing and inheriting ImageLists across multiple forms and controls[^] which sounds perfect but doesn't work with VS2019 and I'd had enough of trying by then) I relent and find an online resource that extracts PNG images form Icons. Except they are all too big at 256x256 and the ICO files don't have the right 64x64 images, just 256x256 and 48x48 and smaller. :sigh: OK ... Corel Paintshop Pro has a batch mode ... finally get that working, import the PNG files, apply, presto! Base form is working. Derive a new form. try to view it in the designer ... "Object reference not set to an instance". Find the reason, add the necessary "if design mode", try again. "System.Windows.Forms.Design.IEventHandlerService already exists in the service container. Parameter name: serviceType" :doh: Finally fix it: change the derived form type to "Form", build, view in the designer. Hurrah! No error (or buttons but hey!). Change it back to Base Form. Build. View in the designer. And it works. Sodding Visual Studio. And it's only Tuesday. I am sooooo glad I didn't make the base form abstract ... I'll do that when its' all working. Deriving a concrete class from an abstract UserControl[^] applies to Forms as well.

                        "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!

                        H Offline
                        H Offline
                        honey the codewitch
                        wrote on last edited by
                        #13

                        I would have done it like this: Create panels or usercontrols containing common elements. Drag those onto each form. It's not perfect, but in my experience doing what you're doing using form inheritance causes more problems than it solves. Just my take on things. *hides*

                        Real programmers use butterflies

                        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