473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Strange problem

Hello group

I have a strange problem. I have a panel. On this panel, I can drop custom
Textbox that I create at runtime. I have a toolbar on witch a delete button
exist. When I click on this button, the application delete the select
Textbox on the panel. I allso give the ability to the Texbox to contains
others Textbox. That mean that my fonction is recursiv.

This is the code when I clik on the delete button

'I check is I have something selected
If Not mobjItemDragDrop Is Nothing Then
'mobjItemDragDrop is the selected Textbox on my
Panel or in an other Texbox
mpDelete(mobjItemDragDrop, mobjItemDragDrop.Parent)

End If

Here is my fonction that I call when I delete something

Private Sub mpDelete(ByRef sender As Control, ByRef senderParent As Control)

Const METHODE As String = "mpDelete"

Dim objItem As clsCustomTB

Try
If sender.Controls.Count > 0 Then
For Each objItem In sender.Controls

If objItem.Controls.Count > 0 Then
mpDelete(objItem, objItem.Parent)
End If

sender.Controls.Remove(objItem)

sender.Refresh()

Next

senderParent.Controls.Remove(sender)

senderParent.Refresh()

Else
senderParent.Controls.Remove(sender)

senderParent.Refresh()

End If

Catch ex As Exception
mgAddErreur(ex,
System.Reflection.Assembly.GetExecutingAssembly.Lo cation, CLASSE, METHODE,
System.Windows.Forms.SystemInformation.ComputerNam e,
System.Windows.Forms.SystemInformation.UserName, True)

End Try

End Sub

The strange Thing is when I check the Count property it is equal to 0 but on
my panel or in my Textbox, I can still see the control that have been
remove. I want to know what I am doing wrong here? Why the count is equal
to 0 but the control still exist? Is there a better way to remove a control
from it parent's?

Thank you
Marc R.
Nov 21 '05 #1
0 879

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rob Ristroph | last post by:
Hi, It's pretty unhelpful to post "I have a huge piece of code that crashes in strange places, what's the problem?" but that's basically my problem and I really am at my wit's end. The piece...
2
by: Paul Drummond | last post by:
Hi all, I am developing software for Linux Redhat9 and I have noticed some very strange behaviour when throwing exceptions within a shared library. All our exceptions are derived from...
25
by: Neil Ginsberg | last post by:
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's...
2
by: TB | last post by:
I am seeing a very strange problem as follows... I have a loop where a fair amount of processing is going on and near the top of the loop I access a class that has only static helper functions...
1
by: Sam Kong | last post by:
Hello! Recently I had a strange problem with Visual C# 2005 beta 1. When I ran(F5 key) a program, <#if DEBUG> statement was not working. It ran as RELEASE mode. So I had to manually define...
8
by: Spam Trap | last post by:
I am getting strange resizing problems when using an inherited form. Controls are moving themselves seemingly randomly, but reproducibly. "frmBase" is my base class (a windows form), and...
11
by: Martin Joergensen | last post by:
Hi, I've encountered a really, *really*, REALLY strange error :-) I have a for-loop and after 8 runs I get strange results...... I mean: A really strange result.... I'm calculating...
12
by: StephQ | last post by:
I have a class Bounds with two constructors: class Bounds { private: list<SegmentupperLinearSpline; // Upper bound. list<SegmentlowerLinearSpline; // Lower bound. ....
8
by: Dox33 | last post by:
I ran into a very strange behaviour of raw_input(). I hope somebody can tell me how to fix this. (Or is this a problem in the python source?) I will explain the problem by using 3 examples....
5
by: ioni | last post by:
Good day, fellows! I have a strange problem – at my site there is a flash strip, that loads data dynamically. It works fine (grabs data from the remote server and presents it), however in IE7...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.