Newbie: View ALL Controls on a form

  • Thread starter Thread starter steve
  • Start date Start date
S

steve

Hi,

I realised that i cannot rename a control using a certain name, because
there already exists another control with that name.
I have been trying to find and delete that other control with no success !!!
I['ve been "Bring to front" all panels and controls in my form and nothing.

Is there way to permanently delete this control?

TIA
-steve
 
steve said:
I realised that i cannot rename a control using a certain name, because
there already exists another control with that name.
I have been trying to find and delete that other control with no success
!!!
I['ve been "Bring to front" all panels and controls in my form and
nothing.

Is there way to permanently delete this control?

Is the control shown in the controls list which is shown on top of the
properties window? If not, post the form's designer generated code.
 
This code will delete the control at runtime, but not permanently delete it.
Each time you run the program you will need to delete the control again
because it still stays in the Form's control collection:

Private Sub RemoveControl(ByVal sName As String)
Dim ctrl As Control
For Each ctrl In Me.Controls
If ctrl.Name = sName Then
Me.Controls.Remove(ctrl)
Exit For
End If
Next
End Sub

Usage:
-------

RemoveControl("TextBox1")

Can change to: 'If ctrl.Name.ToLower() = sName Then' & then you will pass
the control name as lowercase only. This will stop any other problems you
may have.

I hope this helps

Crouchie1998
BA (HONS) MCP MCSE
 
Sorry my mistake, The control WAS visible, they represent similar things
(two checkboxes) and had misnamed one of them.

However, frequently I encounter a situation where I want to click somewhere
(?) and the control wether behind others or not to be somehow highlighted.
Is there such a way ??
I couldnt find anything in the IDE.

Thanx a lot!
-steve

Herfried K. Wagner said:
steve said:
I realised that i cannot rename a control using a certain name, because
there already exists another control with that name.
I have been trying to find and delete that other control with no success
!!!
I['ve been "Bring to front" all panels and controls in my form and
nothing.

Is there way to permanently delete this control?

Is the control shown in the controls list which is shown on top of the
properties window? If not, post the form's designer generated code.
 
Above the property window on the right is a drop down listbox. Just pick the
control from there & it will be highlighted

Crouchie1998
BA (HONS) MCP MCSE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top