When using numericupdown to expand/collapse treeView nodes. Why the collapse part is not working ?
I have a treeView in my form1 designer. The treeView variable name is: treeViewMS1
When i'm running my program the treeView is automatic expanded to level 1:
Now if i click on the numericUpDown and change the value to 2 then:
So the expanded part is working fine when i change of the numericUpDown by one up the expanded is working fine.
Now when it's on level 2 and i change the numericUpDown back to value 1 that's level 1 instead get back to my first screenshot Expanded level 1 it's getting back to the root level 0.
and i want that the collapse part will move only one level back but it dosen't matter if i'm on expanded level 2 or 3 or 5 it will allways jump to 0 to the root.
This is the numericUpDown value changed event:
decimal oldValue;
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
if (numericUpDown1.Value > oldValue)
ExpandToLevel(treeViewMS1.Nodes, (int)numericUpDown1.Value);
else
CollapseToLevel(treeViewMS1.Nodes, (int)numericUpDown1.Value);
oldValue = numericUpDown1.Value;
ExpandToLevel method:
void ExpandToLevel(TreeNodeCollection nodes, int level)
if (level > 0)
foreach (TreeNode node in nodes)
node.Expand();
ExpandToLevel(node.Nodes, level -1);
And CollapseToLevel method:
void CollapseToLevel(TreeNodeCollection nodes, int level)
if (level > 0)
foreach (TreeNode node in nodes)
node.Collapse();
CollapseToLevel(node.Nodes, level - 1);
I solved it this way:
I solved it like this: In the Form1_Load event i did:
SetToLevel(treeViewMS1.Nodes, 1);
In my case i wanted it to begin by default in level 1.
Then in the numericupdown1 changed value event:
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
SetToLevel(treeViewMS1.Nodes, (int)numericUpDown1.Value);
Then the method SetToLevel:
void SetToLevel(TreeNodeCollection nodes, int level)
foreach (TreeNode node in nodes)
node.Collapse(false);
ExpandToLevel(nodes, level);
And last the method EXpandToLevel:
void ExpandToLevel(TreeNodeCollection nodes, int level)
if (level > 0)
foreach (TreeNode node in nodes)
node.Expand();
ExpandToLevel(node.Nodes, level -1);
And now it's working perfect like i wanted it to work. When changing the numericupdown value it's changing the node tree expand/collapse levels.
Similar Messages
-
I bought an Iphone in USA and when i arrived at my home i realise that the dock conector is not working, Apple send me a new one?
renatasantos wrote:
Roaminggnome but i don't live at US.
That does not have anything to do with it.
The warranty is only good in the U.S. -
When I set a panorama picture as my wallpaper in my iPhone 5, the live scrolling is not working. Anyone else having this problem?
Please help me to solve thisEveryone is having the "problem".
That beta feature is not in the final release of iOS 7. -
Links in between 2 Nodes in the Interactive Scripts is not working ,
Hi, Experts
I saw u r reply's Regarding, Interactive Scripts, I felt happy thats Somebody is here with some expertise ,
Here my problem is , we are developing the scripts, we are attching the nodes in the Scripts with Arrow line , But here for Some Scripts that link is working, it means once u click on the node it is going to next level and for Some perticular Scripts this link is not working , in webclient Script navigation is not possible, it mean the link is not picking up ,
Can u help in this issue ,
if , it neccessary i will send the Scrpit XML file to U , so that it is easy to investigate,
i did redesign the Script for lot of time , i think this is happening Because OF JAVA , or ITS error in the Server,
Can u please suggest me in this , it is urgent ..........
Regards
SreelathaI solved it this way:
I solved it like this: In the Form1_Load event i did:
SetToLevel(treeViewMS1.Nodes, 1);
In my case i wanted it to begin by default in level 1.
Then in the numericupdown1 changed value event:
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
SetToLevel(treeViewMS1.Nodes, (int)numericUpDown1.Value);
Then the method SetToLevel:
void SetToLevel(TreeNodeCollection nodes, int level)
foreach (TreeNode node in nodes)
node.Collapse(false);
ExpandToLevel(nodes, level);
And last the method EXpandToLevel:
void ExpandToLevel(TreeNodeCollection nodes, int level)
if (level > 0)
foreach (TreeNode node in nodes)
node.Expand();
ExpandToLevel(node.Nodes, level -1);
And now it's working perfect like i wanted it to work. When changing the numericupdown value it's changing the node tree expand/collapse levels. -
oftenly i need to open pdf documents online from diffrent web site but every time touch pad does work properly on pdf page but not on web pages already opened(vertically). i open same files and web pages with internet exproler but fuctioning smooth
Many thanks.
With those symptoms, I'd try the following document:
Apple software on Windows: May see performance issues and blank iTunes Store
(If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.) -
Why when using Adobe Bridge, I apply a star rating, the rating does not show up in Photoshop Elements. I use Elements as my organizer and Bridge to view as it is much more user friendly. Anyone any solutions??
Most likely you have set the wrong file as the external editor. You don't want the obvious one; that's just a link to the welcome screen. Go back and choose this one, which is hidden away inside the folder Support Files:
-
When using my ipad air it keeps coming off the page I'm on or app I am using and going back to the home screen. Also when using my ipad the screen will go white with a black apple icon in the middle for about 20 seconds then it makes a ping sound and goes to the home screen. Could anyone help please. Thank you :-)
Read here:
http://help.apple.com/ipad/8/#/iPad9a245e3e -
When trying to log into face time I get the registering device does not have appropriate credentials after I sign in, I have OSX 10.8.4 on my Mac Pro. I can log into face time without a problem using my IPAD.>
Please take each of the following steps that you haven't already tried, until the issue is reolved. If there's no resolution after Step 3, post your results.
Step 1
Sign out of iMessage in the Accounts tab of the preferences dialog, then sign back in.
Step 2
Log out of your user account and log back in.
Step 3
Boot in safe mode and test, then reboot as usual and test again.
Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and Wi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. -
I'm using OS 10.6.8 and Mail 4.5. When I receive mails with attachments which are visible the save button doesn't work. And some contacts occasionally have problems opening files sent by me using Mail too. This was never a problem on pre-Intel Mac. A real Mac **** up ! Any ideas ?
Can you drag and drop the attachments visible in the email to the Desktop OK or does that fail ?
Re the sending: Are these recipients on Mac's or PC's as the file type could be an issue, if on Mac's then try setting the Mail Preferences Composing setting to Plain Text not Rich Text and see if that improves things. -
Ive used compressor and then tried to put it in dvdsp put its not working. I am having problems with the audio or when i burn it , i cant play the dvd? any help would be appreciated
I suspect you are attempting to burn an HD DVD, which will not play on a DVD player...
But if you provide more details such as the settings you are applying in Compressor, then we would be able to provide you more accurate information.
How are you adding the files to Compressor?
In FCP, what are your footage properties (command-9) and sequence settings (command-0) -
I was using my iphone 4s and then the app started to not work and then my phone blocked and then when i go on home most of my apps disappeared including my settings so i cant restore with out disabling find my iphone on settings please help me asap thankyou so much
Log in to icloud.com on a web browser with your Apple ID and disable FMiP there.
-
When using iMessage how can I make it so it shows my number not my Apple ID?
When using iMessage how can I make it so it shows my number not my Apple ID?
SETTINGS - MESSAGES - RECEIVE AT - CALLER ID (select your number, instead of your email address)
-
When using tethered capture I often get this notification "The metadata for this photo has been changed by both Lightroom and another application". This slows or stalls the loading of incoming photos. How do I find out which other application is changing the metadata and stop it?
Thanks Sean,
I've had a look at the TC settings dialog and tried to keep it as simple as possible. I also had a copy of LR 4 on the hard drive so have trashed that also incase of any conflicts. LR seems to be running ok now but as said it's an intermittent problem.
I also have a copy of Capture One on the hard drive so am going to uninstall that also in case it is trying to launch. -
When using iCloud Calendar, I am unable to change the color of my work calendar. I have successfully followed the instructions to reset the colors of other calendars as desired. However, this one calendar always defaults to purple. Help!
File>New Calendar to create a new calendar (Groups are for grouping calendars and I should ignore them). When you've created the calendar, control-click on it in the sidebar and choose 'Get Info' There you can select a colour. You can have as many calendars as you like. When you create a new event you can select the calendar it belongs to, and hence the colour it has.
-
When using Numbers with iCloud, a new version is created every time I make a change. I do not want all these revised documents. When I change a document, I commit to that change. How do I shut off this multiple-revision feature of Numbers being pushed to iCloud.
Also....
When using Numbers with iCloud, a new version of the spreadsheet is created even when no revisions have been made. Why is this, and how do I make it stop?
My files are growing.Your plugins list shows outdated plugin(s) with known security and stability risks.
# Java Plug-in 1.5.0_11 for Netscape Navigator (DLL Helper)
# Adobe Shockwave for Director Netscape plug-in, version 11.0
Update the [[Java]] and [[Shockwave|Shockwave for Director]] plugin to the latest version.
See
http://java.sun.com/javase/downloads/index.jsp#jdk (you need JRE)
http://www.adobe.com/shockwave/welcome/
Maybe you are looking for
-
No Template Found while creating Asset
As admin I have created new template, flex definition. As a contributor when trying to create Flex Asset, it is not showing any Template. Gives a message 'No template found. Why it doesn't take the Template created.
-
About Flash P2P live streaming from non-webcam sources
Hello, I am a university student. Our lab is attempting to work on a p2p live streaming using flash p2p features. The media source is not from a webcam but a file from a certain server, which is not directly supported by any of the 4 methods flash pl
-
I am having a problem starting the app server with the following messages in ias.log: kas> error: init of context failed! iPlanet Application Server is running in international mode GXBindInit: GXBindBasic failed GXContextInit: GXBindInit failed 2 ka
-
I can't install or buy some apps after opting out from Family sharing
I created family sharing and used it with my brother. Then I dismissed it. When I try to install or buy apps, which previously were bought by him, appstore requires to enter a password from my brother's icloud. Even if I install a free app.
-
Payment term should be: Payable with next payment run, max 14 days from Document Date. Can you please let me know the possibility of creating such a payment term? thanks venkat