Public Class frmSearchNumber
    Private Sub SearchNumber_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.Icon = frmMain.Icon
    End Sub

    Private Sub txtEditCategoryName_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtcatno.KeyPress
        If (Not Char.IsDigit(e.KeyChar) And Not Char.IsControl(e.KeyChar)) Then e.Handled = True
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Me.Hide()
    End Sub

    Private Sub btnSeachCategoryToEdit_Click(sender As Object, e As EventArgs) Handles btnSeachCategoryToEdit.Click
        Try
            Dim Cat As New FrmCategories
            Dim tbl As DataTable = DB.GetData("Select * from Category where Category_Number =" + txtcatno.Text)
            Parameters.CatNo = tbl.Rows(0)(0).ToString()
            Parameters.CatName = tbl.Rows(0)(1).ToString()
            Me.Hide()
        Catch ex As System.IndexOutOfRangeException
            MessageBox.Show("هذا الرقم غير موجود")
            txtcatno.Clear()
            txtcatno.Select()
        Catch ez As Exception
            MessageBox.Show(ez.Message)
        End Try
    End Sub


End Class