Ucim C-Sharp u skoli vec pola godine i dobio sam zadatak da napravim jedan Webbrosver. Ja sam napravio ono osnovno ( ono sto sam znao ) ali ne znam:
1.: kako da ugodim da kada je
Citat:
buttonzurück
Citat:
buttonvor
2.: favorite dugme u menuitem gde kada kliknem na njega da mi webstrana na kojom se trenutno nalazim udje u favorites,
3.: PrivatCheck dugme u menuitem gde kada ga stikliram da mi strane na kojim cu da idem ne ulaze u history
4.: kada kliknem da stranu iz history da idem na nju.
nadam se da neko moze da mi pomogne...
unapred HVALA
ps.: ja zivim u austriji i malo mi skripi srpski, pa vas molim da bas ne gledate pravopis

Evo i koda:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Webbrowser_IceHound
{
/// <summary>
/// Interaktionslogik für Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void buttonok_Click(object sender, RoutedEventArgs e)
{
try
{
if (textBoxadresse.Text.Contains("http://"))
MeinBrowser.Source = new Uri(textBoxadresse.Text);
else
{
MeinBrowser.Source = new Uri("http://" + textBoxadresse.Text);
textBoxadresse.Text = "http://" + textBoxadresse.Text;
}
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void textBoxadresse_KeyDown(object sender, KeyEventArgs e)
{
try
{
if (e.Key == Key.Enter)
{
if (textBoxadresse.Text.Contains("http://"))
MeinBrowser.Source = new Uri(textBoxadresse.Text);
else
{
MeinBrowser.Source = new Uri("http://" + textBoxadresse.Text);
textBoxadresse.Text = "http://" + textBoxadresse.Text;
}
}
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void MeinBrowser_Navigating(object sender, NavigatingCancelEventArgs e)
{
try
{
textBoxadresse.Foreground = Brushes.Red;
textBoxadresse.Background = Brushes.LightBlue;
labelload.Content = "X";
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void MeinBrowser_LoadCompleted(object sender, NavigationEventArgs e)
{
try
{
textBoxadresse.Foreground = Brushes.Black;
textBoxadresse.Background = Brushes.White;
labelload.Content = "/";
textBoxadresse.Text = MeinBrowser.Source.ToString();
menuHistory.Items.Add(textBoxadresse.Text);
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void buttonzurück_Click(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.GoBack();
}
catch (Exception)
{
return;
}
}
private void buttonvor_Click(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.GoForward();
}
catch (Exception)
{
return;
}
}
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void MenuItem_Click_1(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.GoForward();
}
catch (Exception)
{
return;
}
}
private void MenuItem_Click_2(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.GoBack();
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void MenuItem_SubmenuOpened(object sender, RoutedEventArgs e)
{
try
{
if (MeinBrowser.CanGoBack)
menuzurück.IsEnabled = true;
else
menuzurück.IsEnabled = false;
if (MeinBrowser.CanGoForward)
menuvor.IsEnabled = true;
else
menuvor.IsEnabled = false;
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void menuInfo_Click(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.Source = new Uri("file:///D:/Skola/APR/Webbrowser_IceHound/Webbrowser_IceHound/bin/Debug/help.html");
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void buttonrefresh_Click(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.Refresh();
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void buttonhome_Click(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.Source = new Uri("http://www.google.com");
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void youtube_Click(object sender, RoutedEventArgs e)
{
MeinBrowser.Source = new Uri("http://www.youtube.com");
}
private void moddb_Click(object sender, RoutedEventArgs e)
{
MeinBrowser.Source = new Uri("http://www.moddb.com");
}
private void banana_Click(object sender, RoutedEventArgs e)
{
MeinBrowser.Source = new Uri("http://www.fpsbanana.com");
}
private void menuPrivat_Click(object sender, RoutedEventArgs e)
{
menuHistory.Items.Clear();
}
private void menuFavoritesAdd_Click(object sender, RoutedEventArgs e)
{
}
private void menuPrivatCheck_Click(object sender, RoutedEventArgs e)
{
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Webbrowser_IceHound
{
/// <summary>
/// Interaktionslogik für Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void buttonok_Click(object sender, RoutedEventArgs e)
{
try
{
if (textBoxadresse.Text.Contains("http://"))
MeinBrowser.Source = new Uri(textBoxadresse.Text);
else
{
MeinBrowser.Source = new Uri("http://" + textBoxadresse.Text);
textBoxadresse.Text = "http://" + textBoxadresse.Text;
}
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void textBoxadresse_KeyDown(object sender, KeyEventArgs e)
{
try
{
if (e.Key == Key.Enter)
{
if (textBoxadresse.Text.Contains("http://"))
MeinBrowser.Source = new Uri(textBoxadresse.Text);
else
{
MeinBrowser.Source = new Uri("http://" + textBoxadresse.Text);
textBoxadresse.Text = "http://" + textBoxadresse.Text;
}
}
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void MeinBrowser_Navigating(object sender, NavigatingCancelEventArgs e)
{
try
{
textBoxadresse.Foreground = Brushes.Red;
textBoxadresse.Background = Brushes.LightBlue;
labelload.Content = "X";
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void MeinBrowser_LoadCompleted(object sender, NavigationEventArgs e)
{
try
{
textBoxadresse.Foreground = Brushes.Black;
textBoxadresse.Background = Brushes.White;
labelload.Content = "/";
textBoxadresse.Text = MeinBrowser.Source.ToString();
menuHistory.Items.Add(textBoxadresse.Text);
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void buttonzurück_Click(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.GoBack();
}
catch (Exception)
{
return;
}
}
private void buttonvor_Click(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.GoForward();
}
catch (Exception)
{
return;
}
}
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void MenuItem_Click_1(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.GoForward();
}
catch (Exception)
{
return;
}
}
private void MenuItem_Click_2(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.GoBack();
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void MenuItem_SubmenuOpened(object sender, RoutedEventArgs e)
{
try
{
if (MeinBrowser.CanGoBack)
menuzurück.IsEnabled = true;
else
menuzurück.IsEnabled = false;
if (MeinBrowser.CanGoForward)
menuvor.IsEnabled = true;
else
menuvor.IsEnabled = false;
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void menuInfo_Click(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.Source = new Uri("file:///D:/Skola/APR/Webbrowser_IceHound/Webbrowser_IceHound/bin/Debug/help.html");
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void buttonrefresh_Click(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.Refresh();
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void buttonhome_Click(object sender, RoutedEventArgs e)
{
try
{
MeinBrowser.Source = new Uri("http://www.google.com");
}
catch (Exception)
{
MessageBox.Show("!!! ERROR, CHECK THE CODE or TELL THE DEVELOPER ABOUT THIS PROBLEM !!!");
}
}
private void youtube_Click(object sender, RoutedEventArgs e)
{
MeinBrowser.Source = new Uri("http://www.youtube.com");
}
private void moddb_Click(object sender, RoutedEventArgs e)
{
MeinBrowser.Source = new Uri("http://www.moddb.com");
}
private void banana_Click(object sender, RoutedEventArgs e)
{
MeinBrowser.Source = new Uri("http://www.fpsbanana.com");
}
private void menuPrivat_Click(object sender, RoutedEventArgs e)
{
menuHistory.Items.Clear();
}
private void menuFavoritesAdd_Click(object sender, RoutedEventArgs e)
{
}
private void menuPrivatCheck_Click(object sender, RoutedEventArgs e)
{
}
}
}
[Ovu poruku je menjao Pocetnik94 dana 12.03.2010. u 20:07 GMT+1]
[Ovu poruku je menjao Pocetnik94 dana 12.03.2010. u 23:49 GMT+1]