Solved

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

Posted on 2006-06-30
2
621 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
Comment Utility
Private Const WM_KEYDOWN as Long = &H100
0
 
LVL 69

Assisted Solution

by:Éric Moreau
Éric Moreau earned 50 total points
Comment Utility
Hi ommer,

int should be great

Cheers!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

728 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now