root/lang/vb2005/Tween/Tween/OpenURL.vb @ 17458

Revision 17458, 1.4 kB (checked in by kiri_feather, 6 years ago)

First commit on CodeRepos?.
Ver0091
updating the logic 'Jump to unreaded item' for performance up.

Line 
1Imports System.Windows.Forms
2
3Public Class OpenURL
4
5    Private _selUrl As String
6
7    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
8        If UrlList.SelectedItems.Count = 0 Then
9            Me.DialogResult = Windows.Forms.DialogResult.Cancel
10        Else
11            _selUrl = UrlList.SelectedItem.ToString
12            Me.DialogResult = System.Windows.Forms.DialogResult.OK
13        End If
14        Me.Close()
15    End Sub
16
17    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
18        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
19        Me.Close()
20    End Sub
21
22    Public Sub ClearUrl()
23        UrlList.Items.Clear()
24    End Sub
25
26    Public Sub AddUrl(ByVal strUrl As String)
27        UrlList.Items.Add(strUrl)
28    End Sub
29
30    Public ReadOnly Property SelectedUrl() As String
31        Get
32            If UrlList.SelectedItems.Count = 1 Then
33                Return _selUrl
34            Else
35                Return ""
36            End If
37        End Get
38    End Property
39
40    Private Sub OpenURL_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
41        UrlList.Focus()
42        If UrlList.Items.Count > 0 Then
43            UrlList.SelectedIndex = 0
44        End If
45    End Sub
46End Class
Note: See TracBrowser for help on using the browser.