CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2016
    Posts
    6

    Error: operator '=' is not defined for types system windows forms checkbox

    Received the following error:

    operator '=' is not defined for types system windows forms checkbox

    Code:

    ckb.Checked = True

    If ckb = checkBox1 Then
    refsize1 = ffe.refsize
    ffe.refbuf.CopyTo(refbuf1, 0)

    ElseIf ckb = checkBox2 Then
    refsize2 = ffe.refsize
    ffe.refbuf.CopyTo(refbuf2, 0)

    End if

    Please help

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: Error: operator '=' is not defined for types system windows forms checkbox

    Victor Nijegorodov

  3. #3
    Join Date
    Apr 2016
    Posts
    6

    Re: Error: operator '=' is not defined for types system windows forms checkbox

    About error Operator '<>' in not defined for type 'object' and system.DBNull code bellow

    Private Sub buttonIdentifyn_Click(sender As System.Object, e As System.EventArgs) Handles buttonIdentifyn.Click
    If dataGridView1.CurrentCell.RowIndex >= FpdbDataSet.fplist.Rows.Count Then
    Return
    End If

    Dim ffi As New FormFingerIdentify()
    If ffi.ShowDialog() = DialogResult.OK Then

    Dim row As Integer = 0
    While row < FpdbDataSet.fplist.Rows.Count
    Dim cr As DataRow = Me.FpdbDataSet.fplist.Rows(row)

    Dim i As Int32 = 12
    While i < 22
    If cr(i) <> DBNull.Value Then

    Dim refbuf As Byte() = CType(cr(i), Byte())
    Dim refsize As Integer = refbuf.GetLength(0)

    If fpengine.MatchTemplateOne(ffi.matbuf, refbuf, refsize) > 100 Then
    Dim txt As [String]
    txt = "Succeed>>ID:" + cr.ItemArray.GetValue(0).ToString() + " Name:" + cr.ItemArray.GetValue(1).ToString() + " Finger Number:" + (i - 11).ToString()

    MessageBox.Show(txt, "Search Users")
    Return
    End If
    End If
    i += 1
    End While
    row += 1
    End While

    MessageBox.Show("Fail", "Search Users")
    Return
    End If
    End Sub

    And error operator '=' is not defined for types system windows forms checkbox code bellow

    Public Sub FormUserEnrol_CheckClick(sender As Object, e As EventArgs)
    Dim ckb As CheckBox
    ckb = TryCast(sender, CheckBox)

    Dim ffe As New FormEnrol()
    If ffe.ShowDialog() = DialogResult.OK Then

    ckb.Checked = True
    If ckb = checkBox1 Then
    refsize1 = ffe.refsize
    ffe.refbuf.CopyTo(refbuf1, 0)
    ElseIf ckb = checkBox2 Then
    refsize2 = ffe.refsize
    ffe.refbuf.CopyTo(refbuf2, 0)
    Else

    ckb.Checked = False
    If ckb = checkBox1 Then
    refsize1 = 0

    ElseIf ckb = checkBox2 Then
    refsize2 = 0

    End If
    End Sub

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: Error: operator '=' is not defined for types system windows forms checkbox

    1. Please, use CODE tags while posting code snippets!
    2.
    About error Operator '<>' in not defined for type 'object' and system.DBNull code bellow
    Code:
    ...
    Dim ffi As New FormFingerIdentify()
    If ffi.ShowDialog() = DialogResult.OK Then
    
       Dim row As Integer = 0
       While row < FpdbDataSet.fplist.Rows.Count
          Dim cr As DataRow = Me.FpdbDataSet.fplist.Rows(row)
    
          Dim i As Int32 = 12
          While i < 22
             If cr(i) <> DBNull.Value Then
    Perhaps, you should have better explained what you were trying to compare and with which value?
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured