---------폼1--------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Win32;
namespace tscs1
{
public partial class Form1 : Form
{
RegistryKey regKey = Registry.CurrentUser;
Form2 frm2 = new Form2();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
var key = regKey.OpenSubKey("Software\\Microsoft\\Internet Explorer\\Main");
if (this.tscbbAddress.Text.Length != 0)
{
webBrowser.Navigate(this.tscbbAddress.Text);
}
LoadURL();
}
private void LoadURL()
{
this.tscbbAddress.Items.Clear();
var R_URL = regKey.OpenSubKey("Software\\Microsoft\\Internet Explorer\\TypedURLs");
var i = 1;
string I_URL;
do
{
string val = "url" + i.ToString();
I_URL = Convert.ToString(R_URL.GetValue(val));
if (I_URL != "")
{
this.tscbbAddress.Items.Add(I_URL.ToString());
}
++i;
}
while (I_URL != "");
}
private void tsbtnStop_Click(object sender, EventArgs e)
{
webBrowser.Stop();
}
private void 닫기ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void tsbtnRefresh_Click(object sender, EventArgs e)
{
webBrowser.Refresh();
}
private void tsbtnHome_Click(object sender, EventArgs e)
{
webBrowser.GoHome();
}
private void tsbtnRight_Click(object sender, EventArgs e)
{
webBrowser.GoForward();
}
private void tsbtnLeft_Click(object sender, EventArgs e)
{
webBrowser.GoBack();
}
private void tscbbAddress_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.tscbbAddress.Text.Length != 0)
{
this.webBrowser.Navigate(this.tscbbAddress.Text);
}
}
private void tscbbAddress_KeyPress(object sender, KeyPressEventArgs e)
{
if (this.tscbbAddress.Text != "" && e.KeyChar == (char)13)
{
e.Handled = true;
this.webBrowser.Navigate(this.tscbbAddress.Text);
}
}
private void 인터넷옵션OToolStripMenuItem_Click(object sender, EventArgs e)
{
var frm3 = new Form3();
frm3.ShowDialog();
}
private void 열기ToolStripMenuItem_Click(object sender, EventArgs e)
{
frm2.btnOk.Click += new System.EventHandler(btnOk_Click);
frm2.ShowDialog();
}
private void btnOk_Click(object sender, EventArgs e)
{
if (frm2.cbAddress.Text.Length > 0)
{
this.tscbbAddress.Text = frm2.cbAddress.Text;
this.webBrowser.Navigate(frm2.cbAddress.Text);
frm2.Close();
}
}
}
}
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
» |
웹브라우저 (심화판)
![]() | 관리자2 | 2019.01.02 | 910 |
23 |
파일,이미지 열기,옮기기
![]() | 관리자2 | 2019.01.02 | 449 |
22 |
다운로드 폼 구현
![]() | 관리자2 | 2019.01.02 | 246 |
21 |
프로세스 관리자
![]() | 관리자2 | 2019.01.02 | 155 |
20 |
노드 확장 구현
![]() | 관리자2 | 2019.01.02 | 151 |
19 |
전화번호부 구현
![]() | 관리자 | 2018.12.30 | 187 |
18 |
탭메뉴로 컴퓨터 속성 구현
![]() | 관리자 | 2018.12.30 | 145 |
17 |
폰트바꾸기
![]() | 관리자 | 2018.12.30 | 262 |
16 |
웹브라우저 예제
![]() | 관리자 | 2018.12.30 | 194 |
15 |
트레이 아이콘 사용하기
![]() | 관리자 | 2018.12.30 | 147 |
14 |
메뉴관리 폼
![]() | 관리자 | 2018.12.30 | 175 |
13 |
선택 입출력 박스 사용하기
![]() | 관리자 | 2018.12.29 | 155 |
12 |
파일찾기 사용하기
![]() | 관리자2 | 2018.12.26 | 154 |
11 |
설문조사구현
![]() | 관리자2 | 2018.12.26 | 220 |
10 |
일기장 구현하기
![]() | 관리자2 | 2018.12.26 | 270 |
9 |
프로세싱박스 만들기
![]() | 관리자2 | 2018.12.26 | 152 |
8 |
사진 투명도 조절하기
![]() | 관리자2 | 2018.12.26 | 155 |
7 |
콤보박스로 구구단 구현하기
![]() | 관리자2 | 2018.12.24 | 169 |
6 |
리스트사용하기
![]() | 관리자2 | 2018.12.24 | 150 |
5 |
로그인창
![]() | 관리자2 | 2018.12.24 | 894 |
4 |
웹사이트 이동하기
![]() | 관리자2 | 2018.12.24 | 191 |
3 |
메시지박스 사용하기
![]() | 관리자2 | 2018.12.24 | 154 |
2 |
TextBox사용하기
![]() | 관리자2 | 2018.12.24 | 151 |
1 |
Hello, World
![]() | 관리자2 | 2018.12.24 | 154 |