Stopping A Control From Getting Focus

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 1440 Views - Last Post: 14 April 2013 - 08:35 PM Rate Topic: -----

#16 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3566
  • View blog
  • Posts: 11,079
  • Joined: 05-May 12

Re: Stopping A Control From Getting Focus

Posted 31 March 2013 - 08:24 AM

andrewsw has the correct suggestion.

Remember that this will throw an exception:
int x = int.Parse("");


And the combobox can and will clear out the combobox text field. As the result of clearing the textbox, a text change event will be fired. If your code is unprepared to handle empty or invalid strings, you'll get exceptions thrown.
Was This Post Helpful? 0
  • +
  • -

#17 adn258  Icon User is offline

  • D.I.C Addict

Reputation: 11
  • View blog
  • Posts: 762
  • Joined: 31-August 11

Re: Stopping A Control From Getting Focus

Posted 14 April 2013 - 08:35 PM

View PostSkydiver, on 31 March 2013 - 08:24 AM, said:

andrewsw has the correct suggestion.

Remember that this will throw an exception:
int x = int.Parse("");


And the combobox can and will clear out the combobox text field. As the result of clearing the textbox, a text change event will be fired. If your code is unprepared to handle empty or invalid strings, you'll get exceptions thrown.


Right Right I appreciate your help. I ended up using something else as comboboxes can be a real pain for this kind of issue so I essentially circumvented the entire problem altogether and I think it's actually a better solution but I appreciate your help friend.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2