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. Other Discussions
  3. The Weird and The Wonderful
  4. Dastardly use of ComboBox

Dastardly use of ComboBox

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpphpwpfwinformscom
7 Posts 6 Posters 81 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.
  • J Offline
    J Offline
    Josh Smith
    wrote on last edited by
    #1

    I once inherited a WinForms app, .NET 1.1. The devs who made the app up until that point were comfortable with ASP, but didn't know jack about WinForms. I think it was their first experience with .NET. They needed to pass values between Forms. They decided to do it by putting the values into a hidden ComboBox, and passing a reference to the ComboBox between the Forms! Instead of just creating an ArrayList, they actually drag-dropped a ComboBox onto the MainForm and set the Visible property to false.

    :josh: My WPF Blog[^]

    J D K 3 Replies Last reply
    0
    • J Josh Smith

      I once inherited a WinForms app, .NET 1.1. The devs who made the app up until that point were comfortable with ASP, but didn't know jack about WinForms. I think it was their first experience with .NET. They needed to pass values between Forms. They decided to do it by putting the values into a hidden ComboBox, and passing a reference to the ComboBox between the Forms! Instead of just creating an ArrayList, they actually drag-dropped a ComboBox onto the MainForm and set the Visible property to false.

      :josh: My WPF Blog[^]

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Josh Smith wrote:

      They needed to pass values between Forms. They decided to do it by putting the values into a hidden ComboBox, and passing a reference to the ComboBox between the Forms! Instead of just creating an ArrayList, they actually drag-dropped a ComboBox onto the MainForm and set the Visible property to false.

      Oh dear Lord...sounds like they didn't understand how to share data between classes, which indicates very little OO experience, let alone .NET WinForms. ;P

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: The Lord's Prayer in Aramaic song (audio) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      J D 2 Replies Last reply
      0
      • J Judah Gabriel Himango

        Josh Smith wrote:

        They needed to pass values between Forms. They decided to do it by putting the values into a hidden ComboBox, and passing a reference to the ComboBox between the Forms! Instead of just creating an ArrayList, they actually drag-dropped a ComboBox onto the MainForm and set the Visible property to false.

        Oh dear Lord...sounds like they didn't understand how to share data between classes, which indicates very little OO experience, let alone .NET WinForms. ;P

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: The Lord's Prayer in Aramaic song (audio) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

        J Offline
        J Offline
        Josh Smith
        wrote on last edited by
        #3

        Judah Himango wrote:

        Oh dear Lord...sounds like they didn't understand how to share data between classes, which indicates very little OO experience, let alone .NET WinForms.

        Yep. It turns out that people will pass data between pages in ASP by putting them in hidden dropdowns (I was told this by an ASP guy, but can't verify that it's kosher). When the folks who made that WinForms app decided to use a ComboBox as their collection of choice, they must have never considered that there just might be better ways to go about it! :rolleyes:

        :josh: My WPF Blog[^]

        B 1 Reply Last reply
        0
        • J Judah Gabriel Himango

          Josh Smith wrote:

          They needed to pass values between Forms. They decided to do it by putting the values into a hidden ComboBox, and passing a reference to the ComboBox between the Forms! Instead of just creating an ArrayList, they actually drag-dropped a ComboBox onto the MainForm and set the Visible property to false.

          Oh dear Lord...sounds like they didn't understand how to share data between classes, which indicates very little OO experience, let alone .NET WinForms. ;P

          Tech, life, family, faith: Give me a visit. I'm currently blogging about: The Lord's Prayer in Aramaic song (audio) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

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

          Jeez! They shared a ComboBox, so what's so hard about the data in it!?!

          Dave Kreskowiak Microsoft MVP - Visual Basic

          1 Reply Last reply
          0
          • J Josh Smith

            I once inherited a WinForms app, .NET 1.1. The devs who made the app up until that point were comfortable with ASP, but didn't know jack about WinForms. I think it was their first experience with .NET. They needed to pass values between Forms. They decided to do it by putting the values into a hidden ComboBox, and passing a reference to the ComboBox between the Forms! Instead of just creating an ArrayList, they actually drag-dropped a ComboBox onto the MainForm and set the Visible property to false.

            :josh: My WPF Blog[^]

            D Offline
            D Offline
            Duncan Edwards Jones
            wrote on last edited by
            #5

            I saw an equivalnet at a client site ages ago where the main form had several hundred labels on the bottom, each with "Visible=False". Turned out the dev was using them as "variables that have a change event" :doh:

            '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

            1 Reply Last reply
            0
            • J Josh Smith

              I once inherited a WinForms app, .NET 1.1. The devs who made the app up until that point were comfortable with ASP, but didn't know jack about WinForms. I think it was their first experience with .NET. They needed to pass values between Forms. They decided to do it by putting the values into a hidden ComboBox, and passing a reference to the ComboBox between the Forms! Instead of just creating an ArrayList, they actually drag-dropped a ComboBox onto the MainForm and set the Visible property to false.

              :josh: My WPF Blog[^]

              K Offline
              K Offline
              kryzchek
              wrote on last edited by
              #6

              I came across something similar when I was hired at my current company. I was porting a VB.NET application to C# and noticed that the original developer was using DataGrids as business logic class members to hold data. I guess he wasn't familiar with the System.Data namespace.

              1 Reply Last reply
              0
              • J Josh Smith

                Judah Himango wrote:

                Oh dear Lord...sounds like they didn't understand how to share data between classes, which indicates very little OO experience, let alone .NET WinForms.

                Yep. It turns out that people will pass data between pages in ASP by putting them in hidden dropdowns (I was told this by an ASP guy, but can't verify that it's kosher). When the folks who made that WinForms app decided to use a ComboBox as their collection of choice, they must have never considered that there just might be better ways to go about it! :rolleyes:

                :josh: My WPF Blog[^]

                B Offline
                B Offline
                bluesboy84
                wrote on last edited by
                #7

                Sob! However, if we're talking about pure ASP, in high school I just used sessions to grant persistency between pages. Dunno if this can be done in .NET, i'm not into it ;)

                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