Hi to all expert, ladies coders and gentlemen coders,
I m quite newbie in this. I just started vb.net not long ago..because i was too crazy bout making an application for my own phone. as for now, i m using .net compact framework to code for my wm6.
My program is easy. the purpose is to edit a .ini file by pointing the correct program path for each line .in the ini file.
in my program, a treeview is enabled. By selecting on the treenode, this will return me the full path of a .exe file/app. Unfortunately, in some folders, there are many subfolders (especially: /window) so it would take some time to show the treenode. so, i have made a label to appear when click to expand the tree and disappear the label before end sub. when, i put it to test, the label is not appearing at all when i click to expand "/window" folder in treeview. so what am i mising here?
below is my codemarked in red is the label to appear and disappear)
*************** *************** *************** *********this is configure the mouse click event
Private Sub treeView1_Befor eExpand(ByVal sender As Object, _
ByVal e As System.Windows. Forms.TreeViewC ancelEventArgs) _
Handles treeView1.Befor eExpand
plsWaitlbl.Visi ble = True
'MsgBox("start" )
' —-if leaf node then exit—-
If e.Node.ImageInd ex = icoFile Then Return
' —-remove the dummy node and display
' the subdirectories and files—-
Try
e.Node.Nodes.Cl ear() ' clears all the nodes and...
displayChildNod es(e.Node) ' create the nodes again
Catch err As Exception
MsgBox(err.ToSt ring)
End Try
' —-change the icon for this node to open—-
If e.Node.GetNodeC ount(False) > 0 Then
e.Node.ImageInd ex = icoClose
e.Node.Selected ImageIndex = icoOpen
End If
plsWaitlbl.Visi ble = False
'MsgBox("stop")
End Sub
*************** *************** *************** ****** i m sure this is show the subdirectories and file
Private Sub displayChildNod es(ByVal parentNode As System.Windows. Forms.TreeNode)
Dim FS As New DirectoryInfo(s tripExtraSlash _
(parentNode.Ful lPath))
Dim dirInfo As DirectoryInfo
Dim fileInfo As FileInfo
Try
' —-displays all dirs—-
For Each dirInfo In FS.GetDirectori es()
' —-create a new node to be added—-
Dim node As New TreeNode
node.Text = dirInfo.Name ' name of file or dir
node.ImageIndex = icoClose
node.SelectedIm ageIndex = icoOpen
parentNode.Node s.Add(node)
' —-add the dummy node—-
node.Nodes.Add( "")
Next
Catch err As Exception
MsgBox(err.ToSt ring)
End Try
Try
' —display all files—-
For Each fileInfo In FS.GetFiles()
If fileInfo.Extens ion = ".exe" Or fileInfo.Extens ion = ".lnk" Then
' —-create a new node to be added—-
Dim node As New TreeNode
node.Text = fileInfo.Name
node.ImageIndex = icoFile
node.SelectedIm ageIndex = icoFile
parentNode.Node s.Add(node)
End If
Next
Catch err As Exception
MsgBox(err.ToSt ring)
End Try
End Sub
*************** *************** *************** ******
Public Function stripExtraSlash (ByVal str As String) As String
' —-strip away the extra "\" for
' subdirectories. e.g. \\My documents
Dim path As String
If str.Length > 1 And (Mid(str, 1, 1) = "\") Then
path = Mid(str, 2, str.Length - 1)
Else
path = str
End If
Return path
End Function
*************** *************** *************** ************thi s to set the selected node path to the textbox
Private Sub MenuSelect_Clic k(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MenuSelect.Clic k
pathName = stripExtraSlash (treeView1.Sele ctedNode.FullPa th)
'MsgBox(pathNam e)
appPathtxt.Text = pathName
End Sub
Please enlighten me...
0 1691 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Pavan Arise |
last post by:
Hi all..
This may seem simple..but I am stuck here! I have a frame in which
I have a label. I was trying to change the caption of that label via
code (I mean at runtime & not design time). But there is always an
error saying "Compile error: Method or data member not found" I have
no idea how to solve thsi problem. I have created my label on the
frame itself. I tried to do it witha text box instead of a label...but
in vain...the same error...
|
by: Harvey |
last post by:
Hello:
I am trying to use Autosize=true on a long string and it
extends off of my form, rather than increasing the number
of lines of the Label as the documentation says it should
do.
Would anyone know what other property I need to set to get
this to work properly? I have looked through them all and
cant find any. PreferredHeight is read only.
|
by: WindAndWaves |
last post by:
Hi Gurus
I have a very simple question this time.
I have a continuous form with a textbox (ID number) and a label. The label
has a on_click event: msgbox me.id.value
If I click on the label then I get a message : 1
Now, Imagine I have the cursor on ID = 1 (the first record), then I scroll
|
by: Howie |
last post by:
Hi
I'm producing a Report of electrical devices tested during a long job. I
have a Sub report of Devices inspected visually. If there are no devices
with problems the Sub report is Blank with just the Lable showing. This is
just how I want it. BUT I need some indication that there are no devices to
report on.
I tried a Label saying All OK Nothing to Report but this shows through the
space where the Sub Report is. I need to either hid...
|
by: Alpha |
last post by:
I'm working with a Window based application. I have a small form with just 1
label control which is set as Enabled and Visible. Its text is in black
telling users to please wait while application is updating DB. However, the
form pops up but the label.text is hot showing at all. What should I check
to make this work?
Thanks, Alpha
| |
by: Mike Casey |
last post by:
Hello all,
I have ASP.NET label controls tied to a datasource (so
text will vary in length depending on the record). In IE
everything looks great--text is wrapped if needed. In
Netscape and Opera, the text extends horizontally and does
not wrap.
Any ideas would be most appreciated!
Thanks,
|
by: Kruno |
last post by:
Hi !
if anyone knows the answer I would appreciate it:
I have a user control for the header of the page with
one label in it..I want the label to change as the pages
are changing....
my question:
I want to reference a text property of a label in the control
|
by: Ralph |
last post by:
Hi
I have small function to generate my form controls:
function buildInput(sType, vValue, vId, sName, sLabel){
var oInput = null;
var oLabel = document.createElement('label');
var oCont = document.createElement('span');
var oText = document.createTextNode(sLabel);
oInput = document.createElement('<input type="'+ sType +'" name="'+ sName +'" />');
|
by: Peter Larsen [] |
last post by:
Hi,
I have two questions related to the Label control.
How do i prevent the label from expand the canvas into 2 lines (word wrap)
??
At the moment i set AutoSize to false (to prevent the word wrap from
happening) and Anchor to Left, Right (to enable the with autosize).
How do i prevent a tool-tip from happening if the text is to large to fit in
|
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...
|
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,...
| |
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...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
|
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...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |