Solved

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

Posted on 2006-06-30
2
652 Views
Last Modified: 2008-02-01
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
Comment
Question by:ommer
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 75 total points
ID: 17020781
Private Const WM_KEYDOWN as Long = &H100
0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 50 total points
ID: 17020787
Hi ommer,

int should be great

Cheers!
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question