[ browser ] /
Makaleler-Article(s)
browser ile ilgili toplam 3 makale bulundu ! (A total of 3 article(s) about browser was(were) found in all of articles!)
Article |
---|
folderBrowserDialog Bu makalemizde folderBrowserDialog nesnesini inceleyeceğiz. Formunuza 1 adet folderBrowserDialog, label ve button ekleyin. Aşağıdaki şekilleri inceleyin.
folderBrowserDialog nesnesi ile dizinleri ve alt klasörleri açabilir buna göre uygulamalar geliştirebiliriz.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnAc_Click(object sender, EventArgs e)
{
string dir;
folderBrowserDialog1.ShowNewFolderButton = false;
folderBrowserDialog1.Description = "Dosyalarım...Bahadır";
folderBrowserDialog1.RootFolder = Environment.SpecialFolder.Desktop;
folderBrowserDialog1.ShowDialog();
dir = folderBrowserDialog1.SelectedPath;
label1.Text = "Seçilen Dosya Yolu: " + dir;
}
private void Form1_Load(object sender, EventArgs e)
{
btnAc.Text = "Klasöre Gözat";
label1.Text = "";
}
}
}
//Bir sonraki makalede görüşmek üzere. Bahadır | WebBrowser da Kayan Yazı Bu örnekte webbrowser nesnesinde Navigate girilen yazıyı kaydıracağız.
Aşağıdaki şekilleri inceleyin.
Public Class Form1
Private Sub btnBaslat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBaslat.Click
baslat()
End Sub
Sub baslat()
WebBrowser1.Navigate("about:< body scroll=’no’ >< body bgcolor=white >< marquee scrolldelay=’120’ direction=’Left’style=’font-size: 20pt; font-family: Verdana; color:orangered; font-weight: bold() ’> Merhaba Dünya. Bahadır ŞAHİN< / marquee >")
End Sub
Private Sub btnDurdur_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDurdur.Click
WebBrowser1.Navigate("about:")
End Sub
End Class
Bir sonraki makalede görüşmek üzere. Bahadır ŞAHİN | WebBrowser Formunuza 1 adet WebBrowser, ToolStrip, StatusStrip, Combobox , 2 adet Timer ekleyin. Aşağıdaki şekilleri inceleyin.
Imports System.Net
Imports System.IO
Imports System.Text
Public Class Form1
Inherits System.Windows.Forms.Form
Dim URL As String
Dim i As Integer = 0
Dim j As Integer = 0
Dim tarih As Date = Now()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
With Me
.Text = "Bahadirsa WebBrowser"
.WindowState = FormWindowState.Maximized
.MaximizeBox = False
End With
ToolStripComboBox1.Size = New System.Drawing.Size(500, 30)
ToolStripButton1.ToolTipText = "Geri Al"
ToolStripButton2.ToolTipText = "İleri Al"
ToolStripButton3.ToolTipText = "Durdur"
ToolStripButton4.ToolTipText = "Yenile"
ToolStripButton5.ToolTipText = "Search"
ToolStripButton6.ToolTipText = "Ana Sayfa"
ToolStripButton7.ToolTipText = "Git"
ToolStripComboBox1.Text = "about:blank"
ToolStripStatusLabel1.Text = ToolStripComboBox1.Text + "/" + "" + "sitesine bağlanıyor..."
Timer1.Enabled = True
Timer1.Interval = 1000
Timer2.Enabled = False
Timer2.Interval = 2000
ToolStripStatusLabel3.Text = "Tarih:" + tarih
Me.TabPage1.Text = "Web Sayfası"
Me.TabPage2.Text = "Girilen Web Sayfaları "
TabControl1.Size = New System.Drawing.Size(Me.Width, Me.Height - 80)
Me.TabControl1.TabIndex = 0
TextBox1.ScrollBars = ScrollBars.Vertical
TextBox1.Multiline = True
TextBox1.Size = Me.Size
ToolStripLabel1.Text = "Adres:"
ToolStripLabel1.Font = New Font("Courier", 12, FontStyle.Bold)
ToolStripLabel2.Text = "Git"
ToolStripLabel2.Font = New Font("Courier", 12, FontStyle.Bold)
End Sub
Private Sub ToolStripButton6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton6.Click
WebBrowser1.Navigate("http://www.google.com.tr")
ToolStripComboBox1.Text = "http://www.google.com.tr"
Me.TabControl1.SelectedIndex = 0
Timer2.Enabled = True
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
WebBrowser1.GoBack()
End Sub
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
WebBrowser1.GoForward()
End Sub
Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
WebBrowser1.Stop()
Timer2.Enabled = False
End Sub
Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click
WebBrowser1.Refresh()
Timer2.Enabled = True
End Sub
Private Sub ToolStripButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click
WebBrowser1.GoSearch()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
i = i + 1
ToolStripStatusLabel2.Text = "Saat:" + Format(Now(), "Long Time")
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim dosyauzunlugu As Integer = 50000
ToolStripProgressBar1.Maximum = dosyauzunlugu
j = j + 1
For j = 1 To dosyauzunlugu Step 1
ToolStripProgressBar1.Value = j
If j = dosyauzunlugu Then
Timer2.Enabled = False
ToolStripProgressBar1.Value = 0
Exit Sub
End If
Next j
End Sub
Private Sub WebBrowser1_DocumentTitleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebBrowser1.DocumentTitleChanged
Dim tarih As Date = Now()
Dim baslik As String = ToolStripComboBox1.Text
Static Dim PrevTitle = ""
If baslik <> PrevTitle Then
TextBox1.Text += baslik & vbCrLf & tarih
TextBox1.Text += " " & WebBrowser1.Location.ToString() & vbCrLf & vbCrLf
End If
PrevTitle = baslik
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
ToolStripComboBox1.Text = URL
End Sub
Private Sub ToolStripButton7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton7.Click
Me.TabControl1.SelectedIndex = 0
Windows.Forms.Cursor.Current = Cursors.WaitCursor
If String.Compare(ToolStripComboBox1.Text.Substring(0, 7), "http://") Then
ToolStripComboBox1.Text = "http://" & ToolStripComboBox1.Text.ToString()
End If
Windows.Forms.Cursor.Current = Cursors.Default
WebBrowser1.Navigate(ToolStripComboBox1.Text)
ToolStripComboBox1.Items.Add(ToolStripComboBox1.Text)
ToolStripStatusLabel1.Text = ToolStripComboBox1.Text + "/" + " " + "sitesine bağlanıyor..."
Timer2.Enabled = True
ToolStripStatusLabel3.Text = "Tarih:" + tarih
End Sub
End Class
Bir sonraki makalede görüşmek üzere. Bahadır |
|