Solved

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

Posted on 2006-06-30
2
699 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

628 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