Dastardly use of ComboBox
-
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[^]
-
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[^]
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
-
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
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[^]
-
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
Jeez! They shared a ComboBox, so what's so hard about the data in it!?!
Dave Kreskowiak Microsoft MVP - Visual Basic
-
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[^]
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
-
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[^]
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.
-
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[^]
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 ;)