C# Windows Form MenuItem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jason Huang

    #1

    C# Windows Form MenuItem

    Hi,

    Would someone tell me how to get a MenuItem's Name in a C# Windows Form?
    Thanks for help.


    Jason


  • Jon Skeet [C# MVP]

    #2
    Re: C# Windows Form MenuItem

    Jason Huang wrote:[color=blue]
    > Would someone tell me how to get a MenuItem's Name in a C# Windows Form?
    > Thanks for help.[/color]

    Do you mean the caption? Just use the Text property.

    Jon

    Comment

    • Jason Huang

      #3
      Re: C# Windows Form MenuItem

      Thanks Jon.
      Not the caption, I mean the Name property.

      "Jon Skeet [C# MVP]" <skeet@pobox.co m>
      ???????:1141639 201.540482.3782 0@z34g2000cwc.g ooglegroups.com ...[color=blue]
      > Jason Huang wrote:[color=green]
      >> Would someone tell me how to get a MenuItem's Name in a C# Windows Form?
      >> Thanks for help.[/color]
      >
      > Do you mean the caption? Just use the Text property.
      >
      > Jon
      >[/color]


      Comment

      • Stoitcho Goutsev \(100\)

        #4
        Re: C# Windows Form MenuItem

        Jason,

        MenuItems doesn't have name property. The one that you see in parenthesized
        in the property grid is added at design time and is used to generate the
        name of the variable. This is actually the name of the Site object.

        Menu times can be accessed from their parent by index.



        --

        Stoitcho Goutsev (100)

        "Jason Huang" <JasonHuang8888 @hotmail.com> wrote in message
        news:%2304S3BYQ GHA.648@TK2MSFT NGP14.phx.gbl.. .[color=blue]
        > Thanks Jon.
        > Not the caption, I mean the Name property.
        >
        > "Jon Skeet [C# MVP]" <skeet@pobox.co m>
        > ???????:1141639 201.540482.3782 0@z34g2000cwc.g ooglegroups.com ...[color=green]
        >> Jason Huang wrote:[color=darkred]
        >>> Would someone tell me how to get a MenuItem's Name in a C# Windows Form?
        >>> Thanks for help.[/color]
        >>
        >> Do you mean the caption? Just use the Text property.
        >>
        >> Jon
        >>[/color]
        >
        >[/color]


        Comment

        Working...