473,799 Members | 3,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help w/ TreeView and Images

Hello,

I'm tyring to understand something about using a TreeView ctrl & assigning
the images. For testing purposes I'm just using the VS IDE to create and
assign the contents of the TreeView. When I add a Node I can set the Image,
and or the Selected Image properties for that node. Normally, when a user
interacts with a TreeView (assume the directory style folders), the icon is
a closed folder when collapsed, and when selected. However, it becomes an
open folder image when the user actually opens the node by clicking on the
"+". Doesn't this require a 3rd image to be assigned? How can I get this
same type of behavior when there's only 2 settings? What am I missing here?

TIA,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> jo*********@the rmo.com
Nov 15 '05 #1
2 2678
Hello,

You can extend the TreeView control's functionality programatically .
E.g., if you want to use the 3d image for the expanded nodes you could do
something like that:
- handle the AfterExpand event and change the TreeNode's ImageIndex
property to your 3d image
- handle the AfterCollapse event and change the TreeNode's ImageIndex back
to the default image


Hello,

I'm tyring to understand something about using a TreeView ctrl & assigning
the images. For testing purposes I'm just using the VS IDE to create and
assign the contents of the TreeView. When I add a Node I can set the Image,
and or the Selected Image properties for that node. Normally, when a user
interacts with a TreeView (assume the directory style folders), the icon is
a closed folder when collapsed, and when selected. However, it becomes an
open folder image when the user actually opens the node by clicking on the
"+". Doesn't this require a 3rd image to be assigned? How can I get this
same type of behavior when there's only 2 settings? What am I missing here?

TIA,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> jo*********@the rmo.com


Regards,

Adrian Vinca [MSFT], Developer Division
--------------------------------------------------------------------
This reply is provided "AS IS", without warranty (express or implied).

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.

Nov 15 '05 #2
Adrian,

Thanks for the idea. I'll give it a try and see what happens.

John

"Adrian Vinca [MSFT]" <ad**********@o nline.microsoft .com> wrote in message
news:oW******** ******@cpmsftng xa07.phx.gbl...
Hello,

You can extend the TreeView control's functionality programatically .
E.g., if you want to use the 3d image for the expanded nodes you could do
something like that:
- handle the AfterExpand event and change the TreeNode's ImageIndex
property to your 3d image
- handle the AfterCollapse event and change the TreeNode's ImageIndex back
to the default image


Hello,

I'm tyring to understand something about using a TreeView ctrl & assigningthe images. For testing purposes I'm just using the VS IDE to create and
assign the contents of the TreeView. When I add a Node I can set the Image,and or the Selected Image properties for that node. Normally, when a user
interacts with a TreeView (assume the directory style folders), the icon isa closed folder when collapsed, and when selected. However, it becomes an
open folder image when the user actually opens the node by clicking on the"+". Doesn't this require a 3rd image to be assigned? How can I get this
same type of behavior when there's only 2 settings? What am I missing here?
TIA,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> jo*********@the rmo.com


Regards,

Adrian Vinca [MSFT], Developer Division
--------------------------------------------------------------------
This reply is provided "AS IS", without warranty (express or implied).

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.

Nov 15 '05 #3

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

Similar topics

1
2449
by: Bryan | last post by:
I have a TreeView, with an ImageList. The ImageList's size is set to 20x15, and all of the images it contains are 20x15. When I use it with the TreeView, though, all of the images are scaled to what looks like 16x16. Is there some way I can tell the TreeView not to scale the images, and display 20x15 bitmaps? Thanks, Bryan
3
356
by: frazer | last post by:
hi i have a set of bitmaps in an array. and i want to add it to a imagelist so that i can show those images in my treeview. imageList2.Images.Add (Image.FromHbitmap (picture.Bitmap)); //cant use this gives me an error do i need to convert from bitmap to a memory stream?
2
2000
by: Jurjen de Groot | last post by:
The IE webControls come with standard graphics for the treeview amongst other things, does anyone know of other sets of images so the treeview doesn't look so much like the Windows Explorer tree but a little more sophisticated ? Kind regards, Jurjen de Groot Netherlands
0
1603
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520" AutoPostBackOnNodeMove="false" DragAndDropEnabled="true" NodeEditingEnabled="False" KeyboardEnabled="true" CssClass="TreeView" NodeCssClass="TreeNode" SelectedNodeCssClass="SelectedTreeNode" HoverNodeCssClass="HoverTreeNode" NodeEditCssClass="NodeEdit"
0
2367
by: damiensawyer | last post by:
I have an ASP:Treeview control <asp:TreeView Id="TreeView2" PathSeparator = "|" OnTreeNodePopulate="PopulateNode" ExpandDepth="1" runat="server" cssclass="TreeControl" ExpandImageUrl="~/images/bullets/right.gif" CollapseImageUrl="~/images/bullets/down.gif"
6
11685
by: cyriel1920 | last post by:
Hi, I use the selectednodestyle with a white background so the user can see which item was chosen in the treeview navigation. The nodes have a navigateURL with a target to another frame. Navigating works with no postback and the style follow the selected node. When a new child is added to a node there is a button to refresh the node. This is done by a postback. After this postback the selected node stays keeps the selected style.
2
1665
by: vincent90152900 | last post by:
Following is my code and I want the Panel1 display beside the TreeView1. I found out the ModalPopupExtender has two property, “X”, and “Y”. So, I wish I could find out the position of a TreeView1 in a web page and then I can set the “X” and “Y” of the ModalPopupExtender. Does anyone know how to do that? Or any suggestion is welcome. <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> ...
0
2169
by: bsturg21 | last post by:
Hello, I have an app that has a custom treeview which inherits the base treeview class and I am having a problem with the way the treeview is being redrawn. Each node in the treeview represents a folder, and this problem began when I added the functionality to have a ghost image of the folder when it is dragged and dropped to another location in the treeview. My code to create the ghost image is as follows: this.NodeToBeDeleted =...
1
2921
by: Jeffrey Walton | last post by:
Hi All, I have an array of 16x16 bitmaps (60 total). I've tried adding the array to the ImageList with the Add method, but the TreeView paints as if no BMP is present. The problem is the method does not 'break out' the bitmaps. If I specify Index 0, I get an unexpected result (horizontal compressing of the file).
0
9688
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9546
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.