fav in tree view (Problem)

Some Links works and the other does not work

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

37 Replies - 3954 Views - Last Post: 15 January 2010 - 02:32 AM Rate Topic: -----

#1 moro5000  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 12-December 09

fav in tree view (Problem)

Posted 01 January 2010 - 07:43 PM

in folder link all url work Correctly

and my fav Stopped

DoubleClick Click to view the links correctly

2

How is adding to and deletions, and save links in the tree view

Instance the annex :D
Thanks for all

Attached File(s)


This post has been edited by moro5000: 01 January 2010 - 09:55 PM

Is This A Good Question/Topic? 0
  • +

Replies To: fav in tree view (Problem)

#2 moro5000  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 12-December 09

Re: fav in tree view (Problem)

Posted 02 January 2010 - 07:12 AM

up
Was This Post Helpful? 0
  • +
  • -

#3 moro5000  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 12-December 09

Re: fav in tree view (Problem)

Posted 02 January 2010 - 07:21 PM

I awaited

plz
Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon

Reputation: 2298
  • View blog
  • Posts: 9,535
  • Joined: 29-May 08

Re: fav in tree view (Problem)

Posted 02 January 2010 - 07:33 PM

You stand a better chance of people assisting you if post the problem code.
If I don't like download for a unknown source then it stands to reason that they are others.
Was This Post Helpful? 0
  • +
  • -

#5 moro5000  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 12-December 09

Re: fav in tree view (Problem)

Posted 03 January 2010 - 09:11 AM

View PostAdamSpeight2008, on 2 Jan, 2010 - 06:33 PM, said:

You stand a better chance of people assisting you if post the problem code.
If I don't like download for a unknown source then it stands to reason that they are others.


I awaited

plz
Was This Post Helpful? 0
  • +
  • -

#6 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: fav in tree view (Problem)

Posted 03 January 2010 - 09:27 AM

Maybe you didn't quite understand what @AdamSpeight2008 was saying so let me try and help.

Most people (including myself) will not download an unknown file from an unknown person, so that means no one is seeing your code nor wanting to help because they aren't willing to download your file. Post the code you're having problems with (in code tags, like so :code: )and I'm sure someone will help you.

If you are unwilling to do this then you're probably not going to get a lot of help, as you may have already noticed. If you do not do this please stop bumping this thread as it will do you no good :)
Was This Post Helpful? 0
  • +
  • -

#7 moro5000  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 12-December 09

Re: fav in tree view (Problem)

Posted 03 January 2010 - 07:44 PM

okey

this a code

in folder link all url work Correctly

and my fav Stopped

DoubleClick Click to view the links correctly

2

How is adding to and deletions, and save links in the tree view




Public Class Form1

	Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		Dim CurrentPath As String = System.Environment.GetFolderPath(Environment.SpecialFolder.Favorites)
		Dim FavoriteNodes As New TreeNode("Favorite")
		FavoriteNodes.Tag = CurrentPath
		FavoriteNodes.ImageIndex = 0
		Me.TreeView1.Nodes.Add(FavoriteNodes)
		GetFavotiesFromDirectory(FavoriteNodes, CurrentPath)
	End Sub

	Private Sub GetFavotiesFromDirectory(ByVal MainNode As Object, ByVal CurrentPath As String)
		For Each FavFol As String In My.Computer.FileSystem.GetDirectories(CurrentPath)
			Dim NewNode As New TreeNode(IO.Path.GetFileName(FavFol))
			NewNode.Tag = FavFol
			NewNode.ImageIndex = 1
			GetFavotiesFromDirectory(NewNode, FavFol)
			MainNode.Nodes.Add(NewNode)
		Next
		GetFavorites(MainNode, CurrentPath)
	End Sub

	Private Sub GetFavorites(ByVal MainNode As Object, ByVal CurrentPath As String)
		For Each Fav As String In My.Computer.FileSystem.GetFiles(CurrentPath, 2, "*.url")
			Dim TN As New TreeNode(IO.Path.GetFileNameWithoutExtension(Fav))
			TN.Tag = GetUrl(Fav)
			TN.ImageIndex = 2
			MainNode.Nodes.Add(TN)
		Next
	End Sub

	Private Function GetUrl(ByVal FavPath As String) As String
		Dim FavUrl As String = ""
		Using St As New IO.StreamReader(FavPath, True)
			St.ReadLine()
			FavUrl = St.ReadLine
		End Using
		Return FavUrl.Substring(4)
	End Function

	Private Sub TreeView1_AfterSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
		If e.Node IsNot Nothing Then
			If e.Node.Tag IsNot Nothing Then
				Label1.Text = e.Node.Tag
			End If
		End If
	End Sub

	Private Sub TreeView1_NodeMouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles TreeView1.NodeMouseDoubleClick
		If e.Node IsNot Nothing Then
			If e.Node.Tag IsNot Nothing Then
				WebBrowser1.Navigate(e.Node.Tag)
			End If
		End If
	End Sub
End Class


Was This Post Helpful? 0
  • +
  • -

#8 moro5000  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 12-December 09

Re: fav in tree view (Problem)

Posted 04 January 2010 - 04:57 AM

up
Was This Post Helpful? 0
  • +
  • -

#9 EndLessMind  Icon User is offline

  • Android Expert
  • member icon

Reputation: 272
  • View blog
  • Posts: 1,250
  • Joined: 13-March 09

Re: fav in tree view (Problem)

Posted 04 January 2010 - 07:18 AM

i have one solution for the "delete" problem
here it is
		If MessageBox.Show("Are you sure you want to delete " & "?", "Confirm Delete", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
			File.Delete(tvFavs.SelectedNode.Tag)
			tvFavs.Nodes.Remove(tvFavs.SelectedNode)

Was This Post Helpful? 0
  • +
  • -

#10 moro5000  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 12-December 09

Re: fav in tree view (Problem)

Posted 04 January 2010 - 12:07 PM

thanxxxxxxxxxx EndLessMind



add & save settings
Was This Post Helpful? 0
  • +
  • -

#11 EndLessMind  Icon User is offline

  • Android Expert
  • member icon

Reputation: 272
  • View blog
  • Posts: 1,250
  • Joined: 13-March 09

Re: fav in tree view (Problem)

Posted 04 January 2010 - 12:22 PM

View Postmoro5000, on 4 Jan, 2010 - 11:07 AM, said:

thanxxxxxxxxxx EndLessMind



add & save settings

for the add i have a new form. the form got 2 textbox´s. here is the code for the "save button"
 Try
			If Not Directory.Exists(path) Then
				Directory.CreateDirectory(path)
			End If
		Catch ex As System.Exception
			System.Windows.Forms.MessageBox.Show(ex.Message)
		End Try
		Using outputstream As StreamWriter = File.CreateText(path & textbox1.text & ".your-own-file-Extension")
			Dim s As String = TextBox2.Text

			outputstream.WriteLine("[InternetShortcut]")
			outputstream.WriteLine("URL=" & s)

			outputstream.Close()
		End Using
		Close()


Where textbox1 = name of the file
and textbox2 = the url
:)

and plz use the thanks button :)

This post has been edited by EndLessMind: 04 January 2010 - 12:23 PM

Was This Post Helpful? 0
  • +
  • -

#12 moro5000  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 12-December 09

Re: fav in tree view (Problem)

Posted 04 January 2010 - 06:25 PM

Thanks for the help
But see is my Code
Code which it had attached by the 5 errors



Code at the top of page
	Private Sub GetFavotiesFromDirectory(ByVal MainNode As Object, ByVal CurrentPath As String)
		For Each FavFol As String In My.Computer.FileSystem.GetDirectories(CurrentPath)
			Dim NewNode As New TreeNode(IO.Path.GetFileName(FavFol))
			NewNode.Tag = FavFol
			NewNode.ImageIndex = 1
			GetFavotiesFromDirectory(NewNode, FavFol)
			MainNode.Nodes.Add(NewNode)
		Next
		GetFavorites(MainNode, CurrentPath)
	End Sub

	Private Sub GetFavorites(ByVal MainNode As Object, ByVal CurrentPath As String)
		For Each Fav As String In My.Computer.FileSystem.GetFiles(CurrentPath, 2, "*.url")
			Dim TN As New TreeNode(IO.Path.GetFileNameWithoutExtension(Fav))
			TN.Tag = GetUrl(Fav)
			TN.ImageIndex = 2
			MainNode.Nodes.Add(TN)
		Next
	End Sub

	Private Function GetUrl(ByVal FavPath As String) As String
		Dim FavUrl As String = ""
		Using St As New IO.StreamReader(FavPath, True)
			St.ReadLine()
			FavUrl = St.ReadLine
		End Using
		Return FavUrl.Substring(4)
	End Function

[/quote]



An example of attachments



Where a button to thank
I awaited you


Repeat my thanks to you

Attached File(s)


This post has been edited by moro5000: 04 January 2010 - 06:38 PM

Was This Post Helpful? 0
  • +
  • -

#13 EndLessMind  Icon User is offline

  • Android Expert
  • member icon

Reputation: 272
  • View blog
  • Posts: 1,250
  • Joined: 13-March 09

Re: fav in tree view (Problem)

Posted 04 January 2010 - 08:00 PM

I´ll look in to it :) and then come back :)
the thanks button is as the end every post :)


it´s a text(hyberlink) saying "this post was helpful" :)

but i suggest that you make your own favorites :)
like: application.startupPath & "\favorites\"
and then add all you own files there :)
i did like so, that when i create a new favorite like that or a bookmark, then the program creates a new internet shortcut :)

whats easy :) is a text file that ends with ".url" and the text inside is only need to be:
"[internetshortvut]
url=www.someurl.some"
:)

This post has been edited by EndLessMind: 04 January 2010 - 08:05 PM

Was This Post Helpful? 0
  • +
  • -

#14 moro5000  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 12-December 09

Re: fav in tree view (Problem)

Posted 04 January 2010 - 10:00 PM

I know this idea but after the close of the application does not save my settings
It made me resort to add a file to the favorites windows to ensure program quality
The idea is ...
We made tree view reads Favorites

And you will find a solution to add to favorites



Are you with me to complete the work together
Or you are busy

Tell me


Try again in the project and I'm with you too

Honor your EndLessMind :D
Was This Post Helpful? 0
  • +
  • -

#15 EndLessMind  Icon User is offline

  • Android Expert
  • member icon

Reputation: 272
  • View blog
  • Posts: 1,250
  • Joined: 13-March 09

Re: fav in tree view (Problem)

Posted 05 January 2010 - 05:12 AM

sure :)
i can work with you :)
but i dont see why your settings would not be save´d.
I´ve a webbrowser that has the funktion i was talking about. and it saves allt the settings and allt that without any problem :)
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3