Click here to Skip to main content
15,886,802 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Is it? Has it changed? What about now? Pin
A. A. J. Rodriguez9-Jul-12 5:17
A. A. J. Rodriguez9-Jul-12 5:17 
GeneralRe: Is it? Has it changed? What about now? Pin
Rajesh R Subramanian30-Jun-12 10:01
professionalRajesh R Subramanian30-Jun-12 10:01 
GeneralRe: Is it? Has it changed? What about now? Pin
AspDotNetDev30-Jun-12 10:55
protectorAspDotNetDev30-Jun-12 10:55 
GeneralRe: Is it? Has it changed? What about now? Pin
Mycroft Holmes30-Jun-12 15:41
professionalMycroft Holmes30-Jun-12 15:41 
GeneralRe: Is it? Has it changed? What about now? Pin
greldak1-Jul-12 21:37
greldak1-Jul-12 21:37 
GeneralRe: Is it? Has it changed? What about now? Pin
Jonathan C Dickinson2-Jul-12 0:26
Jonathan C Dickinson2-Jul-12 0:26 
GeneralRe: Is it? Has it changed? What about now? Pin
svella2-Jul-12 4:09
svella2-Jul-12 4:09 
GeneralSet selected value... PinPopular
Sandeep Mewara26-Jun-12 8:31
mveSandeep Mewara26-Jun-12 8:31 
On asking 'how to select value from a combobox based on another combobox selected value', following was replied as one way:
C#
// This code only works if you know how many items are in each collection.
private void m_CmbBox1_SelectedIndexChanged(Object Sender EventArgs e)
{
   switch(m_CmbBox1.SelectedIndex)
   {
      case 0:
         m_CmbBox2.SelectedIndex = 0;
         break;
      case 1:
         m_CmbBox2.SelectedIndex = 1;
         break;
      case 2:
         m_CmbBox2.SelectedIndex = 2;
         break;
      default:
         m_CmbBox2.SelectedIndex = m_CmbBox2.Items.Count - 1;
   }
}

D'Oh! | :doh:

Got to read a comment on this, to which I fully agree: A bright example of anti-programming!


modified 26-Jun-12 14:56pm.

GeneralRe: Set selected value... Pin
fjdiewornncalwe26-Jun-12 8:38
professionalfjdiewornncalwe26-Jun-12 8:38 
GeneralRe: Set selected value... Pin
Sandeep Mewara26-Jun-12 8:59
mveSandeep Mewara26-Jun-12 8:59 
GeneralRe: Set selected value... Pin
OriginalGriff26-Jun-12 8:46
mveOriginalGriff26-Jun-12 8:46 
GeneralRe: Set selected value... Pin
Sandeep Mewara26-Jun-12 9:01
mveSandeep Mewara26-Jun-12 9:01 
GeneralRe: Set selected value... Pin
OriginalGriff26-Jun-12 9:12
mveOriginalGriff26-Jun-12 9:12 
GeneralRe: It makes a little sense... Pin
VallarasuS26-Jun-12 22:57
VallarasuS26-Jun-12 22:57 
GeneralRe: It makes a little sense... Pin
Sandeep Mewara26-Jun-12 23:16
mveSandeep Mewara26-Jun-12 23:16 
GeneralI hope this is not contagious... Pin
CDP180225-Jun-12 22:49
CDP180225-Jun-12 22:49 
GeneralRe: I hope this is not contagious... Pin
OriginalGriff26-Jun-12 8:48
mveOriginalGriff26-Jun-12 8:48 
GeneralRe: I hope this is not contagious... Pin
CDP180226-Jun-12 10:40
CDP180226-Jun-12 10:40 
GeneralRe: I hope this is not contagious... Pin
Brisingr Aerowing26-Jun-12 11:58
professionalBrisingr Aerowing26-Jun-12 11:58 
GeneralRe: I hope this is not contagious... Pin
Rajesh R Subramanian30-Jun-12 10:04
professionalRajesh R Subramanian30-Jun-12 10:04 
GeneralRe: I hope this is not contagious... Pin
Brisingr Aerowing1-Jul-12 12:15
professionalBrisingr Aerowing1-Jul-12 12:15 
GeneralRe: I hope this is not contagious... Pin
ignrod27-Jun-12 1:33
ignrod27-Jun-12 1:33 
GeneralRe: I hope this is not contagious... Pin
dakovinc27-Jun-12 2:35
dakovinc27-Jun-12 2:35 
GeneralRe: I hope this is not contagious... Pin
CDP180228-Jun-12 22:21
CDP180228-Jun-12 22:21 
GeneralRe: I hope this is not contagious... Pin
Brisingr Aerowing29-Jun-12 7:16
professionalBrisingr Aerowing29-Jun-12 7:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.