Click here to Skip to main content
15,886,137 members
Articles / Programming Languages / Visual Basic

Text Log Viewer

Rate me:
Please Sign up or sign in to vote.
3.30/5 (6 votes)
19 Aug 2009CPOL2 min read 53.3K   2.3K   30  
Text Log Viewer
Public Class Frm_RenkSecimi

#Region "Form Olaylari"

    Private Sub FrmRenkSecimi_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        ' DilYukle()

        Lbl_On.ImageList = MainF.img1
        Listele()
        For i As Int16 = 0 To MainF.img1.Images.Count - 1
            CMb_IconIndex.Items.Add("Icon-" & i)
        Next


    End Sub

    Private Sub Btn_Yr_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Yr.Click

        Cd_1.AllowFullOpen = True
        Cd_1.FullOpen = True
        Cd_1.ShowDialog()
        Txt_Yr.Text = Cd_1.Color.ToArgb()

        Lbl_On.ForeColor = System.Drawing.Color.FromArgb(Txt_Yr.Text)


    End Sub

    Private Sub Btn_aaR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_aaR.Click
        Cd_1.AllowFullOpen = True
        Cd_1.FullOpen = True
        Cd_1.ShowDialog()
        Txt_aar.Text = Cd_1.Color.ToArgb()
        Lbl_On.BackColor = System.Drawing.Color.FromArgb(Txt_aar.Text)

    End Sub

    Private Sub Btn_EKle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_EKle.Click
        CLs_Kriterler.Add(New Cls_SatirOZellik(Txt_Kriter.Text, Lbl_On.ForeColor, Lbl_On.BackColor, CMb_IconIndex.SelectedIndex))
        Listele()
    End Sub

    Private Sub SeçiliOlanıSilToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SeçiliOlanıSilToolStripMenuItem.Click



        If Grd_Kriter.SelectedRows.Count > 0 Then

            Dim kriter As String = Grd_Kriter.SelectedRows(0).Cells(1).Value
            For i As Int16 = CLs_Kriterler.Count - 1 To 0 Step -1
                If CLs_Kriterler(i).Tanim = kriter Then
                    CLs_Kriterler.RemoveAt(i)
                End If
            Next
            Listele()
        End If


        'If Lst_Bilgi.SelectedItems.Count > 0 Then
        '    Dim silinecek As String = Lst_Bilgi.SelectedItems(0).SubItems(1).Text
        '    For i As Int16 = CLs_Kriterler.Count - 1 To 0 Step -1
        '        If CLs_Kriterler(i).Tanim = silinecek Then
        '            CLs_Kriterler.RemoveAt(i)
        '        End If
        '    Next
        '    Listele()
        'End If
    End Sub

    Private Sub Btn_Kaydet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Kaydet.Click
        KriterKaydet()
        MsgBox("Renk Bİlgileri Kaydedildi.", MsgBoxStyle.Information)
        SatirTanimYukle()
    End Sub

    Private Sub CMb_IconIndex_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CMb_IconIndex.SelectedIndexChanged
        On Error Resume Next
        Lbl_On.ImageIndex = CMb_IconIndex.SelectedIndex

    End Sub

    Private Sub Grd_Kriter_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles Grd_Kriter.CellClick

        On Error Resume Next
        Txt_Kriter.Text = Grd_Kriter.Rows(e.RowIndex).Cells(1).Value
        Txt_Yr.Text = Grd_Kriter.Rows(e.RowIndex).Cells(2).Value
        Txt_aar.Text = Grd_Kriter.Rows(e.RowIndex).Cells(3).Value

    End Sub

    Private Sub Txt_Kriter_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txt_Kriter.TextChanged
        Lbl_On.Text = Txt_Kriter.Text
    End Sub

#End Region

#Region "sub"

    Sub DilYukle()
        Exit Sub
        Dim Dxml As New XmlPlus.XmlConfig
        Dxml.LoadXmlFromFile(Application.StartupPath & "\dil.xml")
        Me.Text = Dxml.Settings(MDL_Dil)("MForm")(Me.Name.Replace("_", "")).Value()

        For Each obj As Object In Me.Controls
            obj.text = Dxml.Settings(MDL_Dil)("FRenk")(obj.Name.Replace("_", "")).Value()

            For Each s_obj As Object In obj.controls
                s_obj.text = Dxml.Settings(MDL_Dil)("FRenk")(s_obj.Name.Replace("_", "")).Value()

                For Each s_s_obj As Object In s_obj.controls

                Next
            Next

        Next

    End Sub

    Sub Listele()
        Grd_Kriter.Rows.Clear()

        For Each c As Cls_SatirOZellik In CLs_Kriterler

            Dim r1 As New DataGridViewRow

            Dim c1 As New DataGridViewTextBoxCell
            Dim c2 As New DataGridViewTextBoxCell
            Dim c3 As New DataGridViewTextBoxCell
            Dim c4 As New DataGridViewTextBoxCell
            Dim c5 As New DataGridViewImageCell


            CellStil(c1, c) : CellStil(c2, c) : CellStil(c3, c) : CellStil(c4, c)

            If c.ImgIndex <> -1 Then
                c5.Value = MainF.img1.Images(c.ImgIndex)
            End If

            r1.Cells.Add(c1)
            r1.Cells.Add(c2)
            r1.Cells.Add(c3)
            r1.Cells.Add(c4)
            r1.Cells.Add(c5)


            r1.Cells(0).Value = Grd_Kriter.RowCount + 1
            r1.Cells(1).Value = c.Tanim
            r1.Cells(2).Value = c.Renk_Yazi
            r1.Cells(3).Value = c.Renk_ArkaAlan

            Grd_Kriter.Rows.Add(r1)
        Next


    End Sub

#End Region

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Turkey Turkey
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions