473,386 Members | 1,652 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,386 software developers and data experts.

The form is not Removing the tree view Control

I faced problem similar to that of Loren Baker.

I am developing a course timetable using Genetic Algorithm approach. I have cretaed a class named primitiveGA and instantiated an object of that class as pGA. I pass data as treenode to createinitialpop method of pGA and read that tree through initialpopulation property of pGA. I then try to assign that tree to the treeview already placed on my form named tvwInitialPop.

The me.controls.remove(tvwInitialPop) fails to trigger as i check that event of form by placing a msgbox in it.

However, the me.controls.add(tvwInitialPop) executes and msgbox pops up.
But the contents of tree view are not updated and it remains blank. The code used is below:

Private Sub tbrCmdInitAlgo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbrCmdInitAlgo.Click
Try
MsgBox("Asking to create initial population")
pGA.createInitPop(frmBuildConfig.ndDataRoot)
Application.DoEvents()
Me.Controls.Remove(tvwInitialPop)'No msgbox

With pGA.InitialPopulation
.Name = tvwInitialPop.Name
.Location = tvwInitialPop.Location
.Size = tvwInitialPop.Size
End With
tvwInitialPop = pGA.InitialPopulation

Me.Controls.Add(tvwInitialPop)'msgbox displayed but no nodes shown in tvwInitialPop

Catch ex As Exception
MsgBox(ex.ToString)
End Try

End Sub

Private Sub frmExecPAlgo_ControlAdded(ByVal sender As Object, ByVal e As System.Windows.Forms.ControlEventArgs) Handles Me.ControlAdded

MsgBox("Added" & e.Control.Name)

End Sub

Private Sub frmExecPAlgo_ControlRemoved(ByVal sender As Object, ByVal e As System.Windows.Forms.ControlEventArgs) Handles Me.ControlRemoved

MsgBox("Removed" & e.Control.Name)

End Sub
Can someone help me.

M. Shabbir
Jun 27 '08 #1
0 689

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

Similar topics

2
by: Stephan Rose | last post by:
Ok here's my situation... Got an MDI application with a panel to my right that has a tree view for the project stuff, etc. Now if I select an item in the tree view, the tree view gains input...
1
by: Kaye | last post by:
It seems that when I dynamically resize items in a tree-view control, using TVM_SETITEM and the TVITEMEX iIntegral member, things go awry. The window draws properly, but it seems like the RECTs for...
10
by: dwok | last post by:
Does anyone know of a good article that discusses creating a "Tree View" control in ASP.NET? Or perhaps a Tree View Control that comes with source code? I have come across a lot of tree controls...
3
by: Cezar | last post by:
I have a quite simple windows form project. It uses one standard form, a couple of simple controls including the tree control, and ADO.NET. Is there a simple automated way to port, or at least try,...
3
by: Alan Silver | last post by:
Hello, I am just looking at the tree view control, which looks very good, but has some apparent limitations. This could easily be my lack of experience with it. Specifically, I have two...
2
by: dixiecanterbury | last post by:
I have a tree view on a form and I need to pass that treeview to another form keeping the state of the treeview (expanded nodes, etc). After the treeview has been manipulated (added nodes,...
4
by: cb.brite | last post by:
Hello, I have tried this using the MouseEnter/MouseLeave events. However these events do not really refer to the rectangular shape of the form, but the client area (form area minus children...
4
by: rszebras | last post by:
I inherited a database (as a novice at Access) and need to modify it to make it more efficient, i.e., the assignment form needs to autopopulate with the client's name, address, phone number, etc.,...
0
by: rinishrk | last post by:
Hi, I have a web application that contains subfolders Admin and User with related webpages inside them. Within the Admin folder I have a page containing a Tree View Control.I want this tree view...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.