如何禁用树视图中的路径分隔符 [英] how disable path separator in treeview

查看:92
本文介绍了如何禁用树视图中的路径分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 如何在Treeview中禁用路径分隔符
即时通讯使用树状视图显示所有文件和文件夹,即时通讯选择节点或子节点之一,然后将选定的节点或子节点添加到文本框,直到确定
但是我的问题是如果我选择c:\ programs
然后我在文本框中获取o/p为
c:\/程序
那是我的路径分隔符,默认是/
现在我想禁用路径分隔符,即/
如何禁用路径分隔符

解决方案

您是否尝试过将PathSeparator 更改为空字符串?

您可以通过代码treeview.PathSeparator = String.Empty


进行设置.如果根节点标签为c:\,则会出现此问题.解决方案是将标签设置为c:,以剪掉尾随的反斜杠.

例如dirname = dirname.TrimEnd(''\\'');

艾伦.


hi how disable path separator in treeview
im using tree view to display all the files and folders, and im selecting one of the node or childnode and selected node or child node is added to textbox, till this ok
but my problem is if im selecting c:\programs
then im getting the o/p in textbox as
c:\/programs
that is my path seperator by default is /
now i want to disable path seperator i.e /
how to disable path seperator

解决方案

Have you tried simply changing the PathSeparator to an empty string?

you could set this via code treeview.PathSeparator = String.Empty


If the root node label is c:\ then you will get this problem. The solution would be to set the label to c: by trimming off trailing backslashes.

e.g. dirname = dirname.TrimEnd(''\\'');

Alan.


这篇关于如何禁用树视图中的路径分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆