Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to Xbox Chaos: Modding Evolved

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
sackorice

C#
Tutorials For C#!

6 posts in this topic

WebBrowser

In this tutorial we will be making a WebBrowser in C#!

First add a Textbox, 4 buttons, and web browser control

Name The buttons (any order doesn't matter)

Back

Forward

Refresh

Go

Double click "back" button

CODE: webBrowser1.GoBack();

Forward Button

CODE: webBrowser1.GoForward();

Refresh Button

CODE: webBrowser1.Refresh();

Now for the "Go" button

CODE: webBrowser1.Navigate(textbox1.Text);

Now debug

if you want to add a "Stop" Button then the code is webBrowser1.Stop();

File moving/copying/deleting

Now, double click your form. Go to the top, and you should see code saying: using System.Windows.Forms; or something, you want add another one saying: using System.IO;

Now, you are going to tell the computer what directories that are chosen, which will be textbox1 and textbox2 text. We are going to declare strings:

string From = textBox1.Text;
string To = textBox2.Text;

now that we have that, we have to tell the computer to copy the file from string 1 to string 2

System.IO.File.Copy (From, To);

How to Delete

Change the "copy" to "Delete"

Now we can implement our try and catch statements, the code should look like this

private void button1_Click (object sender, EventArgs e)
(

this is a picture of what the code should like entirely

ae79435fb6a70d69745a6f43c8766451.png

Text Editor (Notepad)

Starting off the same way as the file mover/deleter/copier

step1: double click the form and type

using System.IO;

step2: drag a tool strip and a text box

step3: double click the form and type

OpenFileDialog ofd = new OpenFileDialog();[/cpde]
step4: now to code the buttons, double clikc the open button and type
[code]ofd.Filter = "Text Files|*.txt"
if (ofd.ShowDialog() == DialogResult.OK) textBox1.Text = File.ReadAllText(ofd.FileName);

step5: now for the save button, double click it and type

File.WriteAllText (ofd.FileName, textBox1.Text);
MessageBox.Show("Your file has been Saved!");

Hope I helped any of you guys!

Share this post


Link to post
Share on other sites

try doing videos to show step by step or detaild photo's so its easier for some people, because i see all your topics are like this and are not super detailed and need more explained to help beginners

Share this post


Link to post
Share on other sites

try doing videos to show step by step or detaild photo's so its easier for some people, because i see all your topics are like this and are not super detailed and need more explained to help beginners

sorry ill try to make videos but my computer is a dinosaur and takes 5 minutes to open the internet let alone visual studio or anything else

and i will try to get pictures

Share this post


Link to post
Share on other sites

These are C# not VB. Fixed topid title.

Yea i was reading C# and VS tutorials got the name mixed

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0