5 Replies - 752 Views - Last Post: 25 May 2017 - 05:13 PM

#1 hexagod  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 242
  • Joined: 29-October 16

Referencing treeNode(s)?

Posted 25 May 2017 - 11:09 AM

Wassup!
So I'm branching out into using treeNodes to do user Selections in the winform GUI environment and I can't get the treeNode->Checked property to work.

For example:
when I try and use
if (treeNode1->Checked == true)
{
    String^ scriptOut = "Copy-Item " + "\"" + "\\\\xx.xx.xx.xxx\\xxxx\\driver\\" + "\"" + " -Recurse " + "\\\\" + destinationManaged + "\\" + "c$" + "\\move\\" + "\n";
}



my IDE is acting like it doesn't know what treeNode1 is? This is strange because if I look in the Visual Studio code generated by the designed I find this entry:

treeNode1->Checked = true;



... one would think that I could use that exact property in the conditional since I have been doing the same thing for checkBoxes and comboBoxes... why can't I use this same format for conditionals involving treeNodes? Does anyone know how you can use a checked conditional for a treeNode in Visual C++?

Thanks! :tup:

Is This A Good Question/Topic? 0
  • +

Replies To: Referencing treeNode(s)?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13485
  • View blog
  • Posts: 53,845
  • Joined: 12-June 08

Re: Referencing treeNode(s)?

Posted 25 May 2017 - 11:34 AM

I'll bite - what is "treeNode1"?
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5890
  • View blog
  • Posts: 20,101
  • Joined: 05-May 12

Re: Referencing treeNode(s)?

Posted 25 May 2017 - 11:46 AM

Are you sure that the code you have in your original post is in the same scope as where treeNode1 is declared?
Was This Post Helpful? 0
  • +
  • -

#4 hexagod  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 242
  • Joined: 29-October 16

Re: Referencing treeNode(s)?

Posted 25 May 2017 - 11:52 AM

treeNode1 is a node within a tree directory. you can put checkboxes inside a tree structure. Each node has it's own name

View PostSkydiver, on 25 May 2017 - 11:46 AM, said:

Are you sure that the code you have in your original post is in the same scope as where treeNode1 is declared?


Well I would think so... I've been using this same type of reference for months now. I don't see why it would be any different for treeNodes. The treeNodes are declared in the same section as the comboBox(s) and checkBox(s) // both of which I have no problem referencing in this same manner.
Was This Post Helpful? 0
  • +
  • -

#5 hexagod  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 242
  • Joined: 29-October 16

Re: Referencing treeNode(s)?

Posted 25 May 2017 - 01:52 PM

If I ever run into SkyDiver or Modi I'm buying you guys a cup of coffee :eek:
Was This Post Helpful? 0
  • +
  • -

#6 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5890
  • View blog
  • Posts: 20,101
  • Joined: 05-May 12

Re: Referencing treeNode(s)?

Posted 25 May 2017 - 05:13 PM

Have you actually compiled your code? Or are you are relying on IntelliSense? Often in IntelliSense for C++ gets confused until you successfully compile the code. It is not as good as the IntelliSense for C# or VB.NET.

If you are getting a compilation error, you will have to post the exact error you are getting, as well as the relevant parts of your code: headers where things are declared and implementation files where the error is happening.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1