CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2008
    Location
    .NET 4.0/VS 2010
    Posts
    11

    Talking Deleting Objects?

    Hello, im kinda new to C# programming and I was wondering if anyone could tell me how to delete objects, im working on a tiny project and i need to delete some labels and such, unless there is another way to make it so some things disappear while others appear

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Deleting Objects?

    Quote Originally Posted by GunnarJ View Post
    Hello, im kinda new to C# programming and I was wondering if anyone could tell me how to delete objects, im working on a tiny project and i need to delete some labels and such, unless there is another way to make it so some things disappear while others appear
    Typically you set and clear the Visible property of UI Elements.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Nov 2008
    Location
    .NET 4.0/VS 2010
    Posts
    11

    Re: Deleting Objects?

    like label1.visible = false; ?

  4. #4
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Deleting Objects?

    Quote Originally Posted by GunnarJ View Post
    like label1.visible = false; ?
    What happened why tour tired that????

    Remember, when asking questions, always post:

    1) EXACTLY what you did (this means a minimal yet complete piece of code [pasted, not typed] that reproduces your experience.

    2) EXACTLY what happened

    3) EXACTLY what your expected to happen (and why)

    Then you are very likely to get a quick direct answer.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  5. #5
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Deleting Objects?

    Quote Originally Posted by GunnarJ View Post
    like label1.visible = false; ?
    Yea simple make them invisible or if you only want to show another text on them change its text
    Code:
    Label1.text = myNewtext;....
    Where myNewtext is a string containing whatever text you want.
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured