2 Replies - 126 Views - Last Post: 05 February 2012 - 03:18 PM Rate Topic: -----

Topic Sponsor:

#1 scolty  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 259
  • Joined: 27-April 11

if(c is ComboBox) including NumericUpDown for some reason

Posted 05 February 2012 - 02:04 PM

Evening guys,

Im having some issues with a numericUpDown. When i use the following code

if (c is ComboBox)
..


it picked up a NumericUpDown as well (Note, i have preset the max and min values of the NumericUpDown.

I tried the following
if (c is ComboBox && (c.GetType() != NumericUpDown )) 


but it says NumericUpDown is a type but is being used like a variable....

Any ideas?

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: if(c is ComboBox) including NumericUpDown for some reason

#2 tlhIn`toq  Icon User is offline

  • WillMyCodeWork = !FailedWhenYouTriedIt;
  • member icon

Reputation: 3290
  • View blog
  • Posts: 6,898
  • Joined: 02-June 10

Re: if(c is ComboBox) including NumericUpDown for some reason

Posted 05 February 2012 - 02:36 PM

YOu have to compare like items. Types against types


if (c is ComboBox && (c.GetType() != TypeOf(NumericUpDown) ))

Was This Post Helpful? 2
  • +
  • -

#3 scolty  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 259
  • Joined: 27-April 11

Re: if(c is ComboBox) including NumericUpDown for some reason

Posted 05 February 2012 - 03:18 PM

Thanks Clint
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1