Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 734
  • Last Modified:

Option Strict On requires all variable declarations to have an 'As' clause.

I got Option Strict On requires all variable declarations to have an 'As' clause. on the following line of code, when I turn on the option on strict.

Private Const WM_KEYDOWN = &H100

How to add AS into it?

What is WM_KEYDOWN's type?

I got the code clock from http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx#q898q. It added a confirmation popup to the datagrid if user wants to delete a row from it. Here is its only function.

   Public Overrides Function PreProcessMessage(ByRef msg As System.Windows.Forms.Message) As Boolean
        Dim keyCode As Keys = CType((msg.WParam.ToInt32 And Keys.KeyCode), Keys)
        If msg.Msg = WM_KEYDOWN And keyCode = Keys.Delete Then
            If MessageBox.Show("Delete This Row?", "Confirm Delete", MessageBoxButtons.YesNo) = DialogResult.No Then
                Return True
            End If
        End If
        Return MyBase.PreProcessMessage(msg)
    End Function

Thanks!
0
ommer
Asked:
ommer
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Private Const WM_KEYDOWN as Long = &H100
0
 
Éric MoreauSenior .Net ConsultantCommented:
Hi ommer,

int should be great

Cheers!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now