Click here to Skip to main content
15,899,475 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: vb.net listview & arrays Pin
Luc Pattyn30-Sep-10 11:57
sitebuilderLuc Pattyn30-Sep-10 11:57 
QuestionUDP socket on the same host.. Pin
jainiraj28-Sep-10 18:29
jainiraj28-Sep-10 18:29 
QuestionKitchen Printer Pin
εїзεїзεїз27-Sep-10 20:37
εїзεїзεїз27-Sep-10 20:37 
AnswerRe: Kitchen Printer Pin
Dave Kreskowiak28-Sep-10 1:45
mveDave Kreskowiak28-Sep-10 1:45 
GeneralRe: Kitchen Printer Pin
εїзεїзεїз28-Sep-10 23:05
εїзεїзεїз28-Sep-10 23:05 
GeneralRe: Kitchen Printer Pin
Dave Kreskowiak29-Sep-10 2:12
mveDave Kreskowiak29-Sep-10 2:12 
GeneralRe: Kitchen Printer Pin
εїзεїзεїз29-Sep-10 2:57
εїзεїзεїз29-Sep-10 2:57 
QuestionGetCursorPos Pin
Win32SF27-Sep-10 18:59
Win32SF27-Sep-10 18:59 
I'm testing the GetCursorPos function as the code below reflects. The issue I'm running into is that the Worksheet_SelectionChange event for Sheet1 is not capturing the changing X and Y's for the mouse when I'm changing cell positions with the arrow keys. If I click on a new cell, the values change fine. But I need new X and Y computed when I'm moving the cursor with the arrow keys.

<br />
'This is in Module1<br />
Option Explicit<br />
<br />
Private Type POINTAPI<br />
  X As Long<br />
  Y As Long<br />
End Type<br />
<br />
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long<br />
Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long<br />
<br />
Function MouseX(Optional ByVal hWnd As Long) As Long<br />
  Dim lpPoint As POINTAPI<br />
  GetCursorPos lpPoint<br />
  If hWnd Then ScreenToClient hWnd, lpPoint<br />
  MouseX = lpPoint.X<br />
End Function<br />
<br />
Function MouseY(Optional ByVal hWnd As Long) As Long<br />
  Dim lpPoint As POINTAPI<br />
  GetCursorPos lpPoint<br />
  If hWnd Then ScreenToClient hWnd, lpPoint<br />
  MouseY = lpPoint.Y<br />
End Function<br />


<br />
'This is in Sheet1<br />
Option Explicit<br />
<br />
Private Sub Worksheet_SelectionChange(ByVal Target As Range)<br />
Range("A1").Value = MouseX<br />
Range("A2").Value = MouseY<br />
End Sub<br />

AnswerRe: GetCursorPos Pin
Dave Kreskowiak28-Sep-10 1:42
mveDave Kreskowiak28-Sep-10 1:42 
GeneralRe: GetCursorPos Pin
Win32SF28-Sep-10 5:08
Win32SF28-Sep-10 5:08 
GeneralRe: GetCursorPos Pin
Dave Kreskowiak28-Sep-10 6:03
mveDave Kreskowiak28-Sep-10 6:03 
GeneralRe: GetCursorPos Pin
Win32SF28-Sep-10 12:32
Win32SF28-Sep-10 12:32 
GeneralRe: GetCursorPos Pin
Dave Kreskowiak28-Sep-10 16:41
mveDave Kreskowiak28-Sep-10 16:41 
GeneralRe: GetCursorPos Pin
Win32SF28-Sep-10 17:35
Win32SF28-Sep-10 17:35 
GeneralRe: GetCursorPos Pin
Dave Kreskowiak28-Sep-10 18:26
mveDave Kreskowiak28-Sep-10 18:26 
GeneralRe: GetCursorPos Pin
tosch28-Sep-10 19:46
tosch28-Sep-10 19:46 
GeneralRe: GetCursorPos Pin
Win32SF28-Sep-10 20:00
Win32SF28-Sep-10 20:00 
GeneralRe: GetCursorPos Pin
Dave Kreskowiak29-Sep-10 2:11
mveDave Kreskowiak29-Sep-10 2:11 
GeneralRe: GetCursorPos Pin
Win32SF29-Sep-10 5:34
Win32SF29-Sep-10 5:34 
GeneralRe: GetCursorPos Pin
Dave Kreskowiak29-Sep-10 5:44
mveDave Kreskowiak29-Sep-10 5:44 
GeneralRe: GetCursorPos Pin
Win32SF29-Sep-10 18:21
Win32SF29-Sep-10 18:21 
GeneralRe: GetCursorPos Pin
Dave Kreskowiak30-Sep-10 2:00
mveDave Kreskowiak30-Sep-10 2:00 
GeneralRe: GetCursorPos Pin
Win32SF2-Oct-10 7:17
Win32SF2-Oct-10 7:17 
GeneralRe: GetCursorPos Pin
flflshop27-Oct-10 8:27
flflshop27-Oct-10 8:27 
QuestionHow to show message After tabpage is displayed in vb.net?? Pin
Andraw Tang27-Sep-10 12:59
Andraw Tang27-Sep-10 12:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.