Sign in to follow this  
Followers 0
mdes

How to erase/remove a label?

6 posts in this topic

In my application, I draw a lot of labels (+ a tooltip for every of each). I would like to delete all of them; is there another way instead of keeping in an array all the returned controlID, and to loop on all GUICtrlDelete()?

In fact, I would like to erase all the labels, but this cannot be done without GUICtrlDelete().

Thanks for any advice :(


Gestion des congés, RTT, vacances scolaires, autres absences sur Pocket PC : CongésRFV

Share this post


Link to post
Share on other sites



I would think keeping an array is the only way.

Dim $label[4]

$label[0] = GUICtrlCreateLabel()
$label[1] = GUICtrlCreateLabel()
$label[2] = GUICtrlCreateLabel()
$label[3] = GUICtrlCreateLabel()
$label[4] = GUICtrlCreateLabel()

For $I = 0 to UBound($label) - 1
   GUICtrlDelete($label[$I])
Next

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

In fact, I would like to erase all the labels, but this cannot be done without GUICtrlDelete().

If you just want to erase the text of the label, try
GuiCtrlSetDate($ctrlID, "")
Edited by steveR

AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.

Share this post


Link to post
Share on other sites

If you just want to erase the text of the label, try

GuiCtrlSetDate($ctrlID, "")
Not enough, I will have to delete also the Tips.

So, I will delete them with an array and a For Loop :(

I would like to have something like For each $label in gui.Labels or GUI.Labels.Collection.Clear : Don't forbid me to dream :(

Thanks for yours contributions :


Gestion des congés, RTT, vacances scolaires, autres absences sur Pocket PC : CongésRFV

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

The same with tips;

GUICtrlSetTip ( $controlID, "" )
Just loop through them like Burrup showed. In the beta, there is a For..In structure that works with objects and arrays, but nothing like collections.

Edited by steveR

AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

In the beta, there is a For..In structure that works with objects and arrays, but nothing like collections.

I'm often using FOR..IN, but there is no object grouping the labels, nor the tips; so, I will keep the controlsID's in a array and delete them in a FOR GUICtrlDelete(ControlID) loop... as I said in my first post. Edited by mdes

Gestion des congés, RTT, vacances scolaires, autres absences sur Pocket PC : CongésRFV

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0