Page 1 of 1

Need help with WPF coding

PostPosted: 18 Jul 2013, 14:31
by Leeizazombie
Hey i'm new to making these WPF applications, and I was wondering, how do I link my progressbar to my webbrowser? I know how to set up the web browser, but when I click links the progress bar should be there to show the user its working right? so how? o.o

Re: Need help with WPF coding

PostPosted: 18 Jul 2013, 16:00
by Leeizazombie
also I get an error using this:
Code: Select all
  do
            {
               
            } while (chat <= 0);

            string content = new System.Net.WebClient().DownloadString("http://www.leestorage.99k.org/setting/news.txt");
            {
                Thread.Sleep(1000);
                Chat_Box.Text(content);
            }
            }     


Im trying to change the text from my text box with the file on the website, for some reason the .Text part has an error:
Code: Select all
Non-invocable member 'System.Windows.Controls.TextBox' cannot be used like a mothod.

Re: Need help with WPF coding

PostPosted: 18 Jul 2013, 16:06
by Breakdown901
I've never used WPF language before, but try putting "string = content" and the rest of the string, in the same bit as the Thread.Sleep and Chat box, put it above them though.

Re: Need help with WPF coding

PostPosted: 18 Jul 2013, 16:44
by ismellike
Leeizazombie wrote:Im trying to change the text from my text box with the file on the website, for some reason the .Text part has an error:


do Chat_Box.Text=content;

Breakdown901 wrote:I've never used WPF language before, but try putting "string = content" and the rest of the string, in the same bit as the Thread.Sleep and Chat box, put it above them though.


Windows Presentation Foundation is c#, except with something called XAML (zammel).
It's just like a newer WinForms.

Leeizazombie wrote:Hey i'm new to making these WPF applications, and I was wondering, how do I link my progressbar to my webbrowser? I know how to set up the web browser, but when I click links the progress bar should be there to show the user its working right? so how? o.o


I recommend you check this website out. [Here]
Instead of the messagebox showing, you can make it start the progressbar.
Idk how to sync the progressbar with progress though :/

Re: Need help with WPF coding

PostPosted: 18 Jul 2013, 17:04
by Leeizazombie
Thank you so much!

Re: Need help with WPF coding

PostPosted: 19 Jul 2013, 16:43
by Leeizazombie
Aslo I have a problem trying to make my browser go to a URL that was entered in a textbox, here is my attempt:
Code: Select all
private void searchUrl(object sender, RoutedEventArgs e)
        {
            String URLcontent = webaddress.Text;
            browser.Navigate(URLcontent);
        }


webaddress is the name of my textbox, and the code is activate by clicking the search button.