Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7642523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:12:42+00:00 2026-05-31T09:12:42+00:00

I have a label array pointing to a label such as, label_array[i] = a_label;

  • 0

I have a label array pointing to a label such as,

label_array[i] = a_label;

The array has global while label has function scope. Is it possible to delete label via array?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:12:43+00:00Added an answer on May 31, 2026 at 9:12 am

    Usually, you can dispose of your objects just by setting their references to null, the garbage collector will take care of disposing of those objects for you. However, not all objects can be disposed just by setting their reference to null. In fact, all objects that implement IDisposable should be disposed by calling their Dispose method as it the case for GDI objects which require an explicit call to Dispose to free up their resources (see this link for details)

    This is being said, if a_label is a WinForms Label then you should do the following to dispose of it:

    // REMOVE THE LABEL FROM THE PARENT CONTAINER FIRST 
    // AND THEN DO THE FOLLOWING
    label_array[i].Dispose();
    label_array[i] = null;
    

    EDIT
    Just to highlight what @Groo mentioned in the comment below, make sure you remove your Label from the parent container before disposing of it, thanks @Groo!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array that is structured as such: $data = array( abc=>array( label
I have such code: var regions = [{'label': 'array', 'value': '1'}]; //default values $(#auto1).select({
I have set the form decorators in this way: <?php $this->setElementDecorators(array( 'Label', array(array('labelTd' =>
I have a label function like : private function formatDate (item:Object, column:DataGridColumn):String { var
I have a Label, whose content is displayed by a while loop. when i
I have this code, but it doesn't work: $builder->add('name','text',array( 'label' => 'Due Date', ));
I have a form element that I'm setting as required: $this->addElement('text', 'email', array( 'label'
i have a zend drop down style code: $this->addElement('select', 'waistmin', array( 'label' => 'Pants:',
Have this print output from print_r($theobject); SimpleXMLElement Object ( [@attributes] => Array ( [label]
I have following array pattern. Array ( [0] => Array ( [label] => 2011

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.