|
i am not sure if i understod you correctly but you can use the AfterSelect event of the treeview control and you can get the name of the node by using the following line
MsgBox(e.Node.Text)
but for your code, it will be harder to read because you are including the entire path of each file which makes it hard for the user. What i suggest is use the same code as mine (add only the name of the file and use the Name property of the node to store the whole path. if you do this, then you would have to use the line:
MsgBox(e.Node.Name)
instead of the first one. after you get the path of the selected node, then you can use a list view control to display files and folders and do whatever you want to do with them.
hope this makes things more clear.
Khalid
|
|
|
|
|
Dear Sir
Ithank You and I am Very Sory
But Now my problem is can I use a list view control to display files and folders and do whatever you want to do with them.
I need to know how can I display files and folders as larg icons
|
|
|
|
|
to add items you just need to call ListView1.Items.Add("aa" ,0) to add an item called "aa" with icon index of 0
the index of the icons is found from an ImageList control that you have to add and insert images into.
after adding the ImageList, you have to specify the Me.ListView1.LargeImageList = Me.ImageList1 to define the large images of the items and then change the image size in the ImageList to 32,32.
by default, the ListView control displays LargeIcons (after setting up the steps before) but just in case you have to specify the propoprty ListView1.View = View.LargeIcon
hope this helps you..
Khalid
|
|
|
|
|
Hi all
I need a function that coverts first letter of each word in a string to uppercase.
Thanks in advance
|
|
|
|
|
|
(1) Separate Words (hint: use Regex ).
(2) Capitalize the first letter of each found word (Char.ToUpper method maybe handy)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Use StrConv - e.g.
StrConv("yikes a vb function from old vb", VbStrConv.ProperCase)
|
|
|
|
|
I want to built a software in vb.net. We keep the recent updates(latest version). The software can check for recent updates, if there was any recent update the customer gets download link. When customer click on link, the software download the updated files within the application, kind the way Microsoft updates work.
Please help me, how can i built.
raj
|
|
|
|
|
I am not sure how exactly you could code this, but here is an idea.
1) Have a specific url that the program checks for latest updates. Possibly use an XML file to store a list of updates and links to their locations, or a script of some sort that looks at the current product version and suggest updates accordingly.
2) Through a plugin system (possibly in an update directory) you could store the downloads, and when the program starts up you could just have the program look for the latest update.
3) Keep track of which features will be installed or available to the user through the registry.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi all,
I am doing a utility about checking network. I want to set a timeout for it. I mean that if timeout = t, after that time the function of checking network will be stopped. I tried with the Timer control but it failed. I am thinking about multithreading...
Can you help me. Thank you in advanced.
Thanh )
|
|
|
|
|
That depends on how you are "checking the network". So what are you doing and what's the code look like that you're using to do this?
|
|
|
|
|
hi
to all
i am using sqlbase as backend.
i want to develop a webform
i have a textbox , button, and a datagrid in it
in datagrid i have a template column in which i have kept a image control in the itemplate.
i have created a table called movies in my database.
it has mid,mname and murl as columns
mid has a id,
mname has the movie name,
murl consists of the url's of the mname's.
now when type in the mname in the text box. i am gettin the mid and mname in the grid columns. bu not the pics. how to retrieve them.
my code is something like this
coding
---------
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Dim dsOB As New DataSet
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sConnect As String = "provider=SQLBASEOLEDB.1;Persist Security Info=False;User ID=SYSADM;Data Source=LOGIN;Password= HYPER"
Dim dr As DataRow
Dim con As New OleDbConnection
Dim cmd As New OleDbCommand
con.ConnectionString = sConnect
cmd.Connection = con
con.Open()
Dim sSelectOB As String = "select mid,mname from movies where mname like '%" & TextBox1.Text & "%' "
Dim daOB As New OleDbDataAdapter(sSelectOB, sConnect)
'Dim dsOB As New DataSet
daOB.Fill(dsOB,"movies")
Dim str As String
'TextBox1.Text = dsOB.Tables(0).Rows(0).Item(2)
'gridbind()
'Image1.ImageUrl = dsOB.Tables(0).Rows(0).Item(2)
'Image1.ImageUrl =
' bind()
DataGrid1.DataSource = dsOB
DataGrid1.BackImageUrl = dsOB.Tables(0).Rows(0).Item(1)
DataGrid1.DataBind()
'DataGrid1.Items.Item(2)
'DataGrid1.DataKeys.Item(2)
'Response.Pics(dsOB.Tables(0).Rows(0).Item(2))
'Image1.Visible = True
con.Close()
End Sub
Sub bind()
End Sub
Private Sub DataGrid1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.SelectedIndexChanged
'If sender = dsOB.Tables(0).Rows(0).Item(2) Then
' e.Item.Cells(0).Controls(1).Visible = True
'End If
End Sub
Private Sub DataGrid1_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.EditCommand
End Sub
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound
Dim image1 As System.Web.UI.WebControls.Image
If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Then
image1 = CType(e.Item.Cells(0).Controls(1), System.Web.UI.WebControls.Image)
image1.ImageUrl = e.Item.Cells(0).Text
End If
End Sub
End Class
i know that this code is incomplete.
but i will be glad if any one can help mew out in this.
thanks in advance
No End No Begining
|
|
|
|
|
Hi all i have this code, and i want to pass parameters to the function
being executed by the thread
Dim t1 As Thread = New Thread(AddressOf execute)
Dim t2 As Thread = New Thread(AddressOf execute)
t1.Start(1)
t2.Start(1)
sub execute(ByVal num as integer)
''Statements
''
end sub
Regards
|
|
|
|
|
The parameter is sent as the type Object.
Sub execute(num as Object)
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks a Lot it did work.
I have another question how can i keep a thread wait untill the other one finishes. Say i have
Dim t1 As Thread = New Thread(AddressOf execute)
Dim t2 As Thread = New Thread(AddressOf execute)
t1.start(0)
t2.start(1)
But t2 should not start untill t1 finishes. I have to create say varying threads right now i and only creating two threads but i have to actually create as many as there are records in the database. but at the same they won't be more then 5, but could be less even one. At end of the program(thread) i am updating records in the database and that is the reason i dont want to start the next thread before the finish of the first.
Regards
|
|
|
|
|
Use the Join method in the Thread class.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks! for the reply
I am doing that but it requires time period, and in my case the time period will not be fixed, or it won't be a good idea to hardcode the time. is there any other way u can suggest.
Regards
|
|
|
|
|
sabby2006 wrote: I am doing that but it requires time period
No, it doesn't. You can specify a time period as timeout limit, but that is not required.
---
single minded; short sighted; long gone;
|
|
|
|
|
In 1.1 I didn't think paramiters could be passed to a sub called on a new thread. I believe you have to store the data in class level variables accessible to the sub. Not positive of this though.
|
|
|
|
|
Iam new to VB.Net2005.
In the Form Load Event Iam Displaying Data into Datagridviewand I have written a code for Double-click event which is going to disply the data in the relevent textboxes from datagridview.
After Displaying I want to modify the Data and updating it into the Database.
For this I have written the code as:
ds.Tables("emp_details").Rows(n).Item(1) = txtsurname.Text ds.Tables("emp_details").Rows(n).Item(2) = txtname.Text
ds.Tables("emp_details").Rows(n).Item(3) = txtdesg.Text
ds.Tables("emp_details").Rows(n).Item(4) = txtplace.Text
ds.Tables("emp_details").Rows(n).Item(5) = txteligamt.Text
ds.Tables("emp_details").Rows(n).Item(6) = txtfno.Text
ds.Tables("emp_details").Rows(n).Item(7) = txtyear.Text
da.Update(ds.Tables("emp_details"))
But Iam getting the error as :
"Update requires a valid updatecommand when passed Datarow collection with modified rows".
Please suggest me correct code for this updation urgently
ThanX in advance
|
|
|
|
|
|
That is DataAdapter.Update
|
|
|
|
|
|
You're looking for the CommandBuilder class for the database you're using. If you have an Access database, then you'd be using the OleDbCommandBuilder[^]. If SQL Server, SqlCommandBuilder[^].
These classes take the Select command that you gave to your dataadapter and build the other three corresponding SQL commands, DELETE, INSERT, and UPDATE, for you. It will only work with single table Select commands though.
|
|
|
|
|
Hi Dave Kreskowiak,
In ur Previous Reply , u told , one must know the following things
1.low-level file system extension
2.writing a database manager to hold all of the passwords
3.writing a utility to manage the password database
4.and finally, comming up with a method to recover a file if the user ever forgets the password
5.This requires a blackbelt in Windows internals and NTFS
to implement the file folder security by applying the password.
So from where should i start , out of the above points?
I really don't want any code.
I Just want u to guide me.
Thank You
|
|
|
|