I have a treeview that i use for navigation. The user must enter select a new record before they can continue. If the user does not select a new record, they are prompted with a messagebox. The user then selects a new record.
When the user tries to click the same tree node nothing happens. The user can select a different treenode though. Does anybody know why this is and how i can get around it.
Ive tried refreshing and setting checked to false.

private void treeView1_AfterSelect_1(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
if (Tab.RecordNumber == Tab.compaire)

{
MessageBox.Show("Please select New Call before you may continue");
}
else
{
switch(e.Node.Text)
{

case "PHCR Information":
PHCR_Info PHCRForm = new PHCR_Info();
PHCRForm.ShowDialog();
this.Hide();
break;
case "Patient Information":
PInfoFrm PInfoFrm = new PInfoFrm();
PInfoFrm.ShowDialog();
this.Hide();
break;

Thanks
adam

Re: treeview by Peter

Peter
Wed Jan 21 05:27:54 CST 2004

Is TreeView.AfterSelect() fired if you click the same TreeNode?

If not you probably need another event. Maybe TreeView.Click() could help
you, if it is supported...

It would be possible with the MouseDown() event, but you'd need to make your
custom control for that, and check if the mousedown was within the
boundaries of a node etc etc...

/ Peter


"adam" <anonymous@discussions.microsoft.com> wrote in message
news:6A77F432-BD59-48B4-AC26-4A3296D987F2@microsoft.com...
> I have a treeview that i use for navigation. The user must enter select a
new record before they can continue. If the user does not select a new
record, they are prompted with a messagebox. The user then selects a new
record.
> When the user tries to click the same tree node nothing happens. The user
can select a different treenode though. Does anybody know why this is and
how i can get around it.
> Ive tried refreshing and setting checked to false.
>
> private void treeView1_AfterSelect_1(object sender,
System.Windows.Forms.TreeViewEventArgs e)
> {
> if (Tab.RecordNumber == Tab.compaire)
>
> {
> MessageBox.Show("Please select New Call before you may
continue");
> }
> else
> {
> switch(e.Node.Text)
> {
>
> case "PHCR Information":
> PHCR_Info PHCRForm = new PHCR_Info();
> PHCRForm.ShowDialog();
> this.Hide();
> break;
> case "Patient Information":
> PInfoFrm PInfoFrm = new PInfoFrm();
> PInfoFrm.ShowDialog();
> this.Hide();
> break;
>
> Thanks
> adam