Click here to Skip to main content

Visual Basic

 
AnswerRe: TreeView Find Starting from Some Child Node PinmvpEddy Vluggen11-May-13 23:18 
GeneralRe: TreeView Find Starting from Some Child Node [modified] Pinmembertreddie12-May-13 0:50 
GeneralRe: TreeView Find Starting from Some Child Node PinmvpEddy Vluggen12-May-13 2:16 
GeneralRe: TreeView Find Starting from Some Child Node Pinmembertreddie13-May-13 12:04 
GeneralRe: TreeView Find Starting from Some Child Node PinmemberTnTinMn13-May-13 16:13 
GeneralRe: TreeView Find Starting from Some Child Node Pinmembertreddie13-May-13 19:24 
GeneralRe: TreeView Find Starting from Some Child Node PinmvpEddy Vluggen14-May-13 10:10 
GeneralRe: TreeView Find Starting from Some Child Node [modified] Pinmembertreddie14-May-13 12:53 
QuestionStore sha passphrase in code Pinmemberfrankelman11-May-13 3:33 
AnswerRe: Store sha passphrase in code PinmemberGarth J Lancaster11-May-13 3:54 
GeneralRe: Store sha passphrase in code Pinmemberfrankelman11-May-13 9:01 
GeneralRe: Store sha passphrase in code PinmemberGarth J Lancaster11-May-13 18:16 
GeneralRe: Store sha passphrase in code Pinmemberfrankelman12-May-13 3:22 
QuestionConverting a string into a method Pinmembertreddie10-May-13 21:54 
Hi again.
 
I have a peculiar problem that is somewhat reminiscent of vb6's Eval() function.
 
Let's say I have a TreeView populated with an entire harddrive's directory structure, and I want to select the node that contains a folder I am looking for. If I use the .Find method, the search could take forever, and I may end up with multiple places in the TreeView where this name is located. If I already have the full path to the correct folder, then I need a quick way to get to the node without having to search the entire tree.
 
Now, I actually have a quick way of doing this (at least I am confident it will work), but in the process of getting to that solution, I was experimenting with another idea that harks back to that vb6 Eval() function...Sort of. That other idea revolved around selectively expanding a tree branch and testing inside each child node to make sure that the next folder name in my full path could be found there. If so, it would expand that node and continue until all folders in the full path had been exhausted. Theoretically, I would then be at my desired node, which I could then select in the tree. But the problem is that in order to do that, you start at TreeView1.Nodes(0) and do a Find(). Once that node is selected, it gets expanded and you then do a Find() for the second folder, which gets found at Nodes(0).Nodes(x). Moving along in the same fashion, you get to Nodes(0).Nodes(x).Nodes(y), and so on till the task is completed. I think you can see the problem already...Without explicitly setting up Case blocks or If/Else blocks to handle each succession of methods,
Nodes(0)
Nodes(0).Nodes(x)
Nodes(0).Nodes(x).Nodes(y),...

 
there is no way for the code to handle this problem. And such a folder could lie at the tenth childnode, maybe even the twentieth, or more. The point being, it is a kludge to try to estimate when you should stop providing hard-coded cases and pray that some scenario doesn't exceed that limit.
 
That is when I was thinking if there was a way to build a string programatically to whatever length I needed it to be, like,
"TreeView1.Nodes(0).Nodes(x).Nodes(y).Expand"
 
and then convert that string into an actual code statement by having the string "evaluated" as such. Is this possible? As I stated above, I think I found another very elegant solution to my TreeView Find() problem which is simple and quick. But I am curious now, if vb.Net has the ability to turn a string into a code statement, or maybe even multiline text into actual vb.Net code?
AnswerRe: Converting a string into a method PinmemberNeverJustHere11-May-13 1:04 
GeneralRe: Converting a string into a method Pinmembertreddie11-May-13 18:05 
GeneralRe: Converting a string into a method PinmvpDave Kreskowiak11-May-13 20:18 
GeneralRe: Converting a string into a method Pinmembertreddie11-May-13 22:36 
GeneralRe: Converting a string into a method PinmvpDave Kreskowiak12-May-13 5:55 
GeneralRe: Converting a string into a method Pinmembertreddie13-May-13 12:13 
GeneralRe: Converting a string into a method PinmvpDave Kreskowiak13-May-13 13:18 
GeneralRe: Converting a string into a method Pinmembertreddie13-May-13 14:06 
GeneralRe: Converting a string into a method PinmvpDave Kreskowiak13-May-13 19:26 
GeneralRe: Converting a string into a method Pinmembertreddie14-May-13 20:34 
GeneralRe: Converting a string into a method Pinmembertreddie11-May-13 22:42 
AnswerRe: Converting a string into a method Pinmemberdusty_dex11-May-13 1:30 
GeneralRe: Converting a string into a method Pinmembertreddie11-May-13 18:07 
GeneralRe: Converting a string into a method Pinmemberdusty_dex12-May-13 1:01 
GeneralRe: Converting a string into a method Pinmembertreddie12-May-13 1:44 
GeneralRe: Converting a string into a method Pinmemberdusty_dex12-May-13 2:05 
GeneralRe: Converting a string into a method Pinmembertreddie13-May-13 11:13 
GeneralRe: Converting a string into a method Pinmemberdusty_dex13-May-13 11:50 
GeneralRe: Converting a string into a method Pinmembertreddie13-May-13 12:14 
AnswerRe: Converting a string into a method PinmvpEddy Vluggen11-May-13 23:22 
GeneralRe: Converting a string into a method Pinmembertreddie12-May-13 1:53 
GeneralRe: Converting a string into a method PinmvpEddy Vluggen12-May-13 2:05 
GeneralRe: Converting a string into a method Pinmembertreddie13-May-13 11:10 
GeneralRe: Converting a string into a method PinmvpDave Kreskowiak13-May-13 13:19 
GeneralRe: Converting a string into a method Pinmembertreddie13-May-13 14:15 
AnswerRe: Converting a string into a method PinmemberEdward Giles26-Jun-13 0:14 
GeneralRe: Converting a string into a method Pinmembertreddie26-Jun-13 10:43 
QuestionVB + SQL Dbase Pinmemberathan_makubex10-May-13 4:44 
AnswerRe: VB + SQL Dbase PinmvpDave Kreskowiak10-May-13 5:04 
GeneralRe: VB + SQL Dbase Pinmemberathan_makubex10-May-13 5:09 
GeneralRe: VB + SQL Dbase PinmvpDave Kreskowiak10-May-13 5:11 
QuestionRe: VB + SQL Dbase Pinmemberathan_makubex10-May-13 5:15 
QuestionElectronics Interfacing DMM M-3860M to serialport communication with the PC PinmemberStephane3410-May-13 1:27 
AnswerRe: Electronics Interfacing DMM M-3860M to serialport communication with the PC PinmvpDave Kreskowiak10-May-13 5:14 
QuestionAsked: functions written in C/C++ or other language : Microseconds Delays Timers [modified] PinmemberStephane3410-May-13 1:24 
AnswerRe: Asked: functions written in C/C++ or other language : Microseconds Delays Timers PinmvpDave Kreskowiak10-May-13 2:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150302.1 | Last Updated 5 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid