Jump to content

How to erase/remove a label?


Recommended Posts

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

Link to comment
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

qq

Link to comment
Share on other sites

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.
Link to comment
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

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...