Component vs IDE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bram Vandendriesschen

    #1

    Component vs IDE

    Hi,
    I already found the solution to my problem, but I would
    like to discuss it with you.
    I developed a component with a property called Name (of
    type String). Everytime I dropped the component on a form
    the IDE complained with the well-known (and sometimes
    nasty) "object reference not set to an instance ..."
    message. The designer always set Name to null (which is
    normal when you don't use DefaultValue). When I manually
    delete this line, the problem stopped. Seems like this
    statement sets some other (hidden) Name property to null
    (previously set by the designer) instead of my own
    property. I renamed the property and now everything is
    fine (don't want to remove the line everytime).

    Anybody a clue ?
    And of course, sorry if this question has already asked.

    Bram.
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Component vs IDE

    Bram,

    It probably has something to do with the fact that a Name property is
    provided which has the name of the variable which holds the reference. I
    think that the IDE creates derived types and when it sees the Name property,
    it clashes, causing your error.

    That's only a guess.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Bram Vandendriessche n" <bv1976be@nospa m.hotmail.com> wrote in message
    news:03f601c3a9 19$a0ba3420$a50 1280a@phx.gbl.. .[color=blue]
    > Hi,
    > I already found the solution to my problem, but I would
    > like to discuss it with you.
    > I developed a component with a property called Name (of
    > type String). Everytime I dropped the component on a form
    > the IDE complained with the well-known (and sometimes
    > nasty) "object reference not set to an instance ..."
    > message. The designer always set Name to null (which is
    > normal when you don't use DefaultValue). When I manually
    > delete this line, the problem stopped. Seems like this
    > statement sets some other (hidden) Name property to null
    > (previously set by the designer) instead of my own
    > property. I renamed the property and now everything is
    > fine (don't want to remove the line everytime).
    >
    > Anybody a clue ?
    > And of course, sorry if this question has already asked.
    >
    > Bram.[/color]


    Comment

    • Bram Vandendriesschen

      #3
      Re: Component vs IDE


      Entirely true. Maybe it works the same way as a Tooltip
      (implements IExtenderProvid er). It also adds (visually)
      one extra property to the fellow components on a form.
      But then again, we might never really know.
      Bram,
      Thx.
      [color=blue]
      >-----Original Message-----
      >Bram,
      >
      > It probably has something to do with the fact that a[/color]
      Name property is[color=blue]
      >provided which has the name of the variable which holds[/color]
      the reference. I[color=blue]
      >think that the IDE creates derived types and when it sees[/color]
      the Name property,[color=blue]
      >it clashes, causing your error.
      >
      > That's only a guess.
      >
      > Hope this helps.
      >
      >
      >--
      > - Nicholas Paldino [.NET/C# MVP]
      > - mvp@spam.guard. caspershouse.co m
      >
      >"Bram Vandendriessche n" <bv1976be@nospa m.hotmail.com>[/color]
      wrote in message[color=blue]
      >news:03f601c3a 919$a0ba3420$a5 01280a@phx.gbl. ..[color=green]
      >> Hi,
      >> I already found the solution to my problem, but I would
      >> like to discuss it with you.
      >> I developed a component with a property called Name (of
      >> type String). Everytime I dropped the component on a[/color][/color]
      form[color=blue][color=green]
      >> the IDE complained with the well-known (and sometimes
      >> nasty) "object reference not set to an instance ..."
      >> message. The designer always set Name to null (which is
      >> normal when you don't use DefaultValue). When I[/color][/color]
      manually[color=blue][color=green]
      >> delete this line, the problem stopped. Seems like this
      >> statement sets some other (hidden) Name property to null
      >> (previously set by the designer) instead of my own
      >> property. I renamed the property and now everything is
      >> fine (don't want to remove the line everytime).
      >>
      >> Anybody a clue ?
      >> And of course, sorry if this question has already asked.
      >>
      >> Bram.[/color]
      >
      >
      >.
      >[/color]

      Comment

      Working...