adding Favorites Functionality from IE to a Form??

What needs to be done to add "Favorites" Functionality to a Form like in Internet Explorer

I'm not sure what needs to be done to get that kind of Functionality in my Project..

Thxs for the Help in Advance..



Answer this question

adding Favorites Functionality from IE to a Form??

  • jsedlak

    Dont want too Access the Internet Explorer itself.. but just to emulate the Functionality...

    The XML i can do...But what needs to be added to the Form itself other than a Button in the ToolStrip This is fairly new to me..and my 2 books Visual C# 2005 and Pro C# 2005 and the .NET 2.0 Platform dosnt go into detail..

    Can you give a code example for the C# to make the Form emulate the Hide/Show functionality..

    Thxs..


  • Frank J DeFalco

    Well, does your app show HTML pages If not, what sort of 'favourites' do you want to show. At the core level, whatever you want to browse to, you need to store it's name, and some associated data that allows you to complete the request, probably as an XML file.



  • MAOWEIJUN

    I have added a Web Browser To my Form it will store Web Links just like in internet Explorer...

    What i'm working on is a Smart Client but revolving around Media Based Content,So i'm looking for the Same Functionality as the Favorites to store Web Links..

    Be able to Click a Button show it and Hide it at the same time..

    I have put in a Panel with a Split Container with a Single Column...


  • Prakash M

    Ok that Fixed it..The only thing i Did was to Remove the Picture Box as its not Needed now..Everything Resizes and the RichTextBox Shows and Closes,With the Web browser Expanding to the Entire Width of the Form..

    Thxs for all the Help on this its Greatly appreciated & also for having Patience..


  • steve job

    Should i have the Web Browser in a Container of Sorts The problem i'm coming across even when setting the Spliter to Back,Rich TextBox to Forward and Picture Box to Forward..

    Then the WebBrowser to Forward,Expand the Web Browser across the Entire Width of the Form it just covers up the RichTextBox...Its not Pushing the Browser to the Right not allowing me to see all of the RichTexBox itself..

    Even when setting the Web Browser to "Fill" it just goes Black and cant see it..LOL

    I even tried taking the splitter and expanding it across the Entire width of the Form and putting the Web Browser on , didnt help..

    I am using .NET 2.0 with Visual Studio 2005 comes with a Web Browser that you can add..


  • Anssi Lehtonen

    Just to be clear, do you want to access the already existant IE favorites or do you want to emulate the functionality

    If you want to emulate the functionality it is simply a matter a persisting a key/value pair into some form of persistence mechanism (such as a database or XML file).


  • craigw33333

    That is working ...Only thing is its not resizing the form..I get a Big Black Space off to left of my Form, Leaving the Browser off set to the Right...lol

    Get a Big Black space on the left...

    Any idea's on how i can apply the Auto Sizing to all the Objects so it all matches up

    I have the Web Browser in a GroupBox, MenuBar and ToolStrip in a Panel and StatusStrip in a Panel Also...

    Thxs in Advance..


  • ceedee

    yes the orderring of it on the form has some effect on the docking ... try "Bring to Front" and "Send to Back", it will change the orderring of the items and will change the docking.

    Cheers,

    Greg


  • ReNgA

    ok for 2k5 ..

    put a splitter container on your form (will contain 2 sides)

    set property Panel1MinSize on Splitter to 0

    put a button on the right hand side ... select top for docking, it will anchor to the top of the container.

    put a picturebox on th left hand side, select "fill" docking (change the color of its background to make things more obvious)

    put a webbrowser on the right hand side, select "fill" docking

    added a member variable

    int m_LastSplitterDistance = 0;

    in the button click I changed the code to ...

    int tmp = this.splitterContainer1.SplitterDistance;
    this.splitterContainer1.SplitterDistance = m_LastSplitterDistance;
    m_LastSplitterDistance = tmp;

    I am not very familiar with this splitter control, there may be a better way of telling it to show/hide controls and I will default to other's judgement on this; but this seems to give the behavior you wanted.

    Cheers,

    Greg


  • Jesse - MSFT

    The same favourites, or it's own list

    If your own, you want to store page names and URLs in an XML file, and then browse to a page when the user selects it from a menu you generate.



  • Luc Morin

    You have to set the "Docking" property of your controls ...

    This will cause the controls to automatically fill areas of the form as it re-sizes.

    Greg


  • DongGyoun

    Set the Group box to Auto Size and set the Dockings for each in the Group Box, Also set the Docking for the Splitter to the Left,Rich Text Box to the Left and left the Picture box UnDocked..

    Because when i Docked it to the left Also the PictureBox wouldnt cover up the RichTextBox when i clicked the ToolStripButton..

     

    Any Ideas


  • Elham Sarikhani

    here ... this is in 1.1 but should work in 2.0 as well (sitting in a coffee shop with only 1.1 :) ) 

    If not the theory is that I am using docking .. I then simply change the visibility of the control and the docking will automatically resize the rest of the controls for me.

    Cheers,

    Greg

     

    using System;

    using System.Drawing;

    using System.Collections;

    using System.ComponentModel;

    using System.Windows.Forms;

    using System.Data;

    namespace WindowsApplication1

    {

    /// <summary>

    /// Summary description for Form1.

    /// </summary>

    public class Form1 : System.Windows.Forms.Form

    {

    private System.Windows.Forms.Button button1;

    private System.Windows.Forms.PictureBox pictureBox1;

    private System.Windows.Forms.Splitter splitter1;

    private System.Windows.Forms.RichTextBox richTextBox1;

    /// <summary>

    /// Required designer variable.

    /// </summary>

    private System.ComponentModel.Container components = null;

    public Form1()

    {

    //

    // Required for Windows Form Designer support

    //

    InitializeComponent();

    //

    // TODO: Add any constructor code after InitializeComponent call

    //

    }

    /// <summary>

    /// Clean up any resources being used.

    /// </summary>

    protected override void Dispose( bool disposing )

    {

    if( disposing )

    {

    if (components != null)

    {

    components.Dispose();

    }

    }

    base.Dispose( disposing );

    }

    #region Windows Form Designer generated code

    /// <summary>

    /// Required method for Designer support - do not modify

    /// the contents of this method with the code editor.

    /// </summary>

    private void InitializeComponent()

    {

    this.button1 = new System.Windows.Forms.Button();

    this.pictureBox1 = new System.Windows.Forms.PictureBox();

    this.splitter1 = new System.Windows.Forms.Splitter();

    this.richTextBox1 = new System.Windows.Forms.RichTextBox();

    this.SuspendLayout();

    //

    // button1

    //

    this.button1.Dock = System.Windows.Forms.DockStyle.Top;

    this.button1.Location = new System.Drawing.Point(103, 0);

    this.button1.Name = "button1";

    this.button1.Size = new System.Drawing.Size(189, 23);

    this.button1.TabIndex = 0;

    this.button1.Text = "button1";

    this.button1.Click += new System.EventHandler(this.button1_Click);

    //

    // pictureBox1

    //

    this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Left;

    this.pictureBox1.Location = new System.Drawing.Point(0, 0);

    this.pictureBox1.Name = "pictureBox1";

    this.pictureBox1.Size = new System.Drawing.Size(100, 273);

    this.pictureBox1.TabIndex = 1;

    this.pictureBox1.TabStop = false;

    //

    // splitter1

    //

    this.splitter1.Location = new System.Drawing.Point(100, 0);

    this.splitter1.Name = "splitter1";

    this.splitter1.Size = new System.Drawing.Size(3, 273);

    this.splitter1.TabIndex = 2;

    this.splitter1.TabStop = false;

    //

    // richTextBox1

    //

    this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;

    this.richTextBox1.Location = new System.Drawing.Point(103, 0);

    this.richTextBox1.Name = "richTextBox1";

    this.richTextBox1.Size = new System.Drawing.Size(189, 273);

    this.richTextBox1.TabIndex = 3;

    this.richTextBox1.Text = "richTextBox1";

    //

    // Form1

    //

    this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

    this.ClientSize = new System.Drawing.Size(292, 273);

    this.Controls.Add(this.button1);

    this.Controls.Add(this.richTextBox1);

    this.Controls.Add(this.splitter1);

    this.Controls.Add(this.pictureBox1);

    this.Name = "Form1";

    this.Text = "Form1";

    this.ResumeLayout(false);

    }

    #endregion

    /// <summary>

    /// The main entry point for the application.

    /// </summary>

    [STAThread]

    static void Main()

    {

    Application.Run(new Form1());

    }

    private void button1_Click(object sender, System.EventArgs e) {

    this.pictureBox1.Visible = !this.pictureBox1.Visible;

    }

    }

    }


  • adding Favorites Functionality from IE to a Form??