Click here to Skip to main content
15,915,869 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: May be bad code or May not be!!! Pin
Ravi Sant12-May-11 19:05
Ravi Sant12-May-11 19:05 
GeneralRe: May be bad code or May not be!!! Pin
Richard Deeming13-May-11 2:35
mveRichard Deeming13-May-11 2:35 
GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant13-May-11 3:33
Ravi Sant13-May-11 3:33 
GeneralRe: May be bad code or May not be!!! Pin
Luc Pattyn12-May-11 4:16
sitebuilderLuc Pattyn12-May-11 4:16 
GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant12-May-11 19:03
Ravi Sant12-May-11 19:03 
GeneralRe: May be bad code or May not be!!! Pin
mahendren12-May-11 20:25
mahendren12-May-11 20:25 
GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant12-May-11 20:28
Ravi Sant12-May-11 20:28 
GeneralRe: May be bad code or May not be!!! Pin
Narf the Mouse12-May-11 19:02
Narf the Mouse12-May-11 19:02 
GeneralRe: May be bad code or May not be!!! Pin
R. Erasmus12-May-11 21:06
R. Erasmus12-May-11 21:06 
GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant12-May-11 21:07
Ravi Sant12-May-11 21:07 
GeneralRe: May be bad code or May not be!!! Pin
R. Erasmus12-May-11 21:09
R. Erasmus12-May-11 21:09 
GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant12-May-11 21:19
Ravi Sant12-May-11 21:19 
JokeRe: May be bad code or May not be!!! Pin
DragonsRightWing13-May-11 7:56
DragonsRightWing13-May-11 7:56 
GeneralRe: May be bad code or May not be!!! Pin
Stefan_Lang12-May-11 21:57
Stefan_Lang12-May-11 21:57 
GeneralRe: May be bad code or May not be!!! Pin
Ravi Sant12-May-11 21:58
Ravi Sant12-May-11 21:58 
GeneralRe: May be bad code or May not be!!! Pin
whiteclouds12-May-11 22:08
whiteclouds12-May-11 22:08 
GeneralRe: May be bad code or May not be!!! Pin
Kent K13-May-11 3:39
professionalKent K13-May-11 3:39 
GeneralRe: May be bad code or May not be!!! Pin
frattaro13-May-11 5:11
frattaro13-May-11 5:11 
GeneralPlease laugh at me so I never do this again... Pin
henrikqwerty32112-May-11 0:34
henrikqwerty32112-May-11 0:34 
GeneralRe: Please laugh at me so I never do this again... Pin
JP_Rocks12-May-11 0:45
JP_Rocks12-May-11 0:45 
GeneralRe: Please laugh at me so I never do this again... Pin
henrikqwerty32112-May-11 0:54
henrikqwerty32112-May-11 0:54 
GeneralRe: Please laugh at me so I never do this again... Pin
JP_Rocks12-May-11 0:59
JP_Rocks12-May-11 0:59 
GeneralRe: Please laugh at me so I never do this again... Pin
henrikqwerty32112-May-11 1:39
henrikqwerty32112-May-11 1:39 
GeneralRe: Please laugh at me so I never do this again... Pin
Joshi, Rushikesh12-May-11 23:16
professionalJoshi, Rushikesh12-May-11 23:16 
GeneralRe: Please laugh at me so I never do this again... Pin
RobCroll12-May-11 3:27
RobCroll12-May-11 3:27 
Now that is a fail. Shouldn't the routine be called at worst SetUIEnabled or even better EnableControls. The code block doesn't activate anything.

Maybe a more elegant solution would be to iterate through the forms controls and ignore the few controls you wish to remain enabled.

Public Sub EnableControls(ByVal Enabled As Boolean)
    For Each FormControl As Control In Me.Controls
        FormControl.Enabled = Enabled
    Next
End Sub


Personally I didn't see anything wrong with your original solution except that the routine names were lower case.
"You get that on the big jobs."

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.