Hi, ich hab den IE eingebunden aber irgendwie klappt das mit dem aktualisieren net, am besten poste ich mal den code.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace IT_News_Viewer
{
/// <summary>
/// Summary description for WinForm.
/// </summary>
public class WinForm : System.Windows.Forms.Form
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private AxSHDocVw.AxWebBrowser axWebBrowser1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Label label1;
public WinForm()
{
//
// 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()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(WinForm));
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.axWebBrowser1 = new AxSHDocVw.AxWebBrowser();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.axWebBrowser1)).BeginInit();
this.SuspendLayout();
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem2});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.Text = &quot;Datei&quot;;
//
// menuItem2
//
this.menuItem2.Index = 1;
this.menuItem2.Text = &quot;Hilfe&quot;;
//
// axWebBrowser1
//
this.axWebBrowser1.Enabled = true;
this.axWebBrowser1.Location = new System.Drawing.Point(8, 32);
this.axWebBrowser1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject(&quot;axWebBrowser1.OcxState&quot;)));
this.axWebBrowser1.Size = new System.Drawing.Size(600, 480);
this.axWebBrowser1.TabIndex = 0;
this.axWebBrowser1.Enter += new System.EventHandler(this.axWebBrowser1_Enter);
//
// button1
//
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Location = new System.Drawing.Point(8, 0);
this.button1.Name = &quot;button1&quot;;
this.button1.Size = new System.Drawing.Size(88, 24);
this.button1.TabIndex = 1;
this.button1.Text = &quot;aktualisieren&quot;;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Location = new System.Drawing.Point(120, 0);
this.button2.Name = &quot;button2&quot;;
this.button2.TabIndex = 2;
this.button2.Text = &quot;zurück&quot;;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button3.Location = new System.Drawing.Point(216, 0);
this.button3.Name = &quot;button3&quot;;
this.button3.TabIndex = 3;
this.button3.Text = &quot;vorwärts&quot;;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button4.Location = new System.Drawing.Point(312, 0);
this.button4.Name = &quot;button4&quot;;
this.button4.TabIndex = 4;
this.button4.Text = &quot;abbrechen&quot;;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(472, 0);
this.label1.Name = &quot;label1&quot;;
this.label1.Size = new System.Drawing.Size(136, 16);
this.label1.TabIndex = 5;
this.label1.Text = &quot;Vorsicht! Beta Version !!!&quot;;
//
// WinForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(616, 514);
this.Controls.Add(this.label1);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.axWebBrowser1);
this.Menu = this.mainMenu1;
this.Name = &quot;WinForm&quot;;
this.Text = &quot;IT News Viewer&quot;;
((System.ComponentModel.ISupportInitialize)(this.axWebBrowser1)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new WinForm());
}
private void axWebBrowser1_Enter(object sender, System.EventArgs e)
{
System.Object nullObject = 0;
string str = &quot;&quot;;
System.Object nullObjStr = str;
Cursor.Current = Cursors.WaitCursor;
axWebBrowser1.Navigate(&quot;[URL]http://192.168.0.1/itnv/&quot[/URL];, ref nullObject, ref nullObjStr, ref nullObjStr, ref nullObjStr); // Index Seite
Cursor.Current = Cursors.Default;
}
private void button1_Click(object sender, System.EventArgs e)
{
axWebBrowser1.Refresh(); /// Aktuallisieren
}
private void button2_Click(object sender, System.EventArgs e)
{
axWebBrowser1.GoBack(); ///zurück
}
private void button3_Click(object sender, System.EventArgs e)
{
axWebBrowser1.GoForward(); /// vorwärts
}
private void button4_Click(object sender, System.EventArgs e)
{
axWebBrowser1.Stop(); /// abbrechen
}
}
}
Viele Grüße
Alexander
Hi!
Bei mir meckert er wegen dem fett markierten rum:
private [B]AxSHDocVw[/B] .AxWebBrowser axWebBrowser1;
Er kann das nicht finden. Was ist das?
Hier noch ein hinweiß. Hier muss das Semikolon direkt hinter dem 2. >-Zeichen weg, aber das sollte bei dir ja ncht mehr drin sein:
axWebBrowser1.Navigate("http://192.168.0.1/itnv/",
...
Code-Hacker
axWebBrowser ist eine Komponente , die in der DLL
AxSHDocView.dll definiert ist
bei Vs.net einfach referenzieren
Achso. Ok, danke. Werde ich mir bei Gelegenheit mal angucken.
Code-Hacker