Results 1 to 2 of 2

Thread: Problem creating Favorites Web browser

  1. #1
    AndersonDiaz is offline Senior Member
    Join Date
    Dec 2009
    Posts
    311
    Rep Power
    3

    Default Problem creating Favorites Web browser

    I want to create favorite Web browser. I will try. But the problem is: I want to have watched as the Webbrowser.documenttitle Text and once you click on it, the Webbrowser.url.tostring

    Here is my some coding part.
    Code:


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    {
    ListViewItem item1 = new ListViewItem();
    item1.Name = TextBox2.Text;
    item1.Text = TextBox1.Text;
    FrmBase.ListView1.Items.Add(item1);
    My.Settings.FavList.Add(TextBox2.Text);
    My.Settings.HistoricCombobox.Add(TextBox1.Text);
    this.Close();
    }
    Private Sub ListView1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _Handles ListView1.MouseUp
    {
    ListViewHitTestInfo hti = ListView1.HitTest(e.Location);
    string url = hti.Item.Name;
    ((WebBrowser)TabControl1.SelectedTab.Controls.Item (0)).Navigate(url);
    }
    {
    foreach (string item in My.Settings.FavList)
    {
    foreach (string itemm in My.Settings.HistoricCombobox)
    {
    ListViewItem item1 = new ListViewItem();
    item1.Name = item.ToString;
    item1.Text = itemm.ToString;
    ListView1.Items.Add(item1);
    }
    }
    }

  2. #2
    TaylorRyan is offline Senior Member
    Join Date
    Dec 2009
    Posts
    306
    Rep Power
    3

    Default

    I check the code in My. Settings you write two objects List (Of String). look out, the lists do not give you the assurance to be indexed in order! In your code you perform two loops so it is normal that you get double values.
    I recommend in its place to create a dictionary in My.Settings SortedDictonnary or if it should be in alphabetical order.

    Then:

    My.setting.MyDictionary = new Dictionary (Of String, String)

    Follow the given code which is helpful for you.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    {
    ListViewItem item1 = new ListViewItem();
    item1.Name = TextBox2.Text;
    item1.Text = TextBox1.Text;
    FrmBase.ListView1.Items.Add(item1);
    My.Settings.MyDictionary.Add(TextBox2.Text, TextBox1.Text);
    this.Close();
    }
    Private Sub ListView1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _Handles ListView1.MouseUp
    {
    ListViewHitTestInfo hti = ListView1.HitTest(e.Location);
    string url = hti.Item.Name;
    ((WebBrowser)TabControl1.SelectedTab.Controls.Item (0)).Navigate(url);
    }
    foreach (string item in My.Settings.FavList)
    {
    foreach (string itemm in My.Settings.HistoricCombobox)
    {
    ListViewItem item1 = new ListViewItem();
    item1.Name = item.ToString;
    item1.Text = itemm.ToString;
    ListView1.Items.Add(item1);
    }
    }
    }

Similar Threads

  1. Creating Mozilla Firefox your default browser
    By CollinsBrown in forum General Internet Terms
    Replies: 0
    Last Post: 07-24-2010, 02:36 PM
  2. My graphic card creating problem ?
    By Damario Elonzo in forum Graphic Card
    Replies: 1
    Last Post: 02-16-2010, 09:27 AM
  3. Browser problem with my Website
    By qeintine641 in forum General Internet Terms
    Replies: 0
    Last Post: 02-06-2009, 06:45 AM
  4. Internet Browser having problem
    By aldrin in forum General Internet Terms
    Replies: 0
    Last Post: 01-16-2009, 07:45 AM
  5. Browser or Time Out Problem with firefox and IE
    By arsenal in forum General Internet Terms
    Replies: 2
    Last Post: 01-12-2009, 06:32 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48