packages/Windows API Code Pack 1.1/source/Samples/Shell/TabbedThumbnailDemo/CS/Winforms/Form1.cs
/// <summary>
/// Navigates to the given path or URL file.
/// Uses the currently selected tab
/// </summary>
/// <param name="path"></param>
Navigates to the given path or URL file.
Uses the currently selected tab
Navigates to the given path or URL file . Uses the currently selected tab
internal void Navigate(string path)
        {
            string[] lines = File.ReadAllLines(path);
            string urlString = "";
            foreach (string line in lines)
            {
                if (line.StartsWith("URL="))
                {
                    urlString = line.Replace("URL=", "");
                    break;
                }
            }
            if (!string.IsNullOrEmpty(path) && tabControl1.TabPages.Count > 0 && tabControl1.SelectedTab != null)
            {
                if (tabControl1.SelectedTab.Controls[0] is WebBrowser)
                {
                    ((WebBrowser)tabControl1.SelectedTab.Controls[0]).Navigate(urlString);
                }
            }
            else
            {
                comboBox1.Text = urlString;
                button1_Click(this, EventArgs.Empty);
            }
        }
internal void Navigate ( string path ) { string [ ] lines = File . ReadAllLines ( path ) ; string urlString = " " ; foreach ( string line in lines ) { if ( line . StartsWith ( " " ) ) { urlString = line . Replace ( " " , " " ) ; break ; } } if ( ! string . IsNullOrEmpty ( path ) && tabControl1 . TabPages . Count > 0 && tabControl1 . SelectedTab != null ) { if ( tabControl1 . SelectedTab . Controls [ 0 ] is WebBrowser ) { ( ( WebBrowser ) tabControl1 . SelectedTab . Controls [ 0 ] ) . Navigate ( urlString ) ; } } else { comboBox1 . Text = urlString ; button1_Click ( this , EventArgs . Empty ) ; } }
Navigates to the given path or URL file.
Navigates to the given path or URL file .
// Simulate a click
path
string
None