Flux rss

VB6 monitoring the mouse track or a straight line on a form

Published by netty5, last update on Monday November 17, 2008 11:38:03 AM by aquarelle





Here are some tips on how you can monitor some lines in a straight line on a form

Random lines


To follow that track the mouse, click on the form, press and hold the right button and move.
Release button to finish.

Straight Lines


To draw straight lines, click on the form, from the starting point and press and hold the button, move the mouse pointer to the destination point and release the button.

E.g
For this function, move the code as shown below.
It can be used on any control that contains an hdc.
Option Explicit
Const PS_SOLID = 0
Const Epp = 10 'size of the line

Private Type POINTAPI
  X As Long
  Y As Long
End Type
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
Private Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, _
  ByVal X As Long, ByVal Y As Long, lpPoint As Any) As Long


Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DeleteObject SelectObject(Me.hdc, CreatePen(PS_SOLID, Epp, RGB(0, 255, 0)))
    MoveToEx Me.hdc, X, Y, &H0
End Sub

'Put the code in Form_MouseUp for a straight line
'without a line>> If Button <> 1 Then Exit Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button <> 1 Then Exit Sub
    DeleteObject SelectObject(Me.hdc, CreatePen(PS_SOLID, Epp, RGB(0, 255, 0)))
    LineTo Me.hdc, X, Y
    Me.Refresh
End Sub
[Linux]Having a daily report of servers by mail [Linux]Having a daily report of servers by mail The monitoring and administration of Linux systems is a very difficult task when there is large number of interconnected servers, system resources and updates to each of them it,must... en.kioskea.net/faq/sujet-789-linux-having-a-daily-report-of-servers-by-mail
Laptop trouble Hello, i have a green vertical line that comes when i start my laptop..it's just a straight line...and i dunno what it is.. en.kioskea.net/forum/affich-32877-laptop-trouble
Monitor. mouse, keyboard doesn't work. Hello, im having a problem with my system, and i was wondering if anybody can help me out with this. Everything was working last night, and right after i connected my phone into the USB , my desk top screen went black and the mouse, keyboard, and even... en.kioskea.net/forum/affich-27230-monitor-mouse-keyboard-doesn-t-work
Formatting your Flashdisk (USB Key )Formatting your Flashdisk (USB Key) How to format your USB Key? It is compulsory to format your USB Key regularly if you are frequently performing File transfer to one computer to another. Your computer can get infected with potential... en.kioskea.net/faq/sujet-186-formatting-your-flashdisk-usb-key
Using an USB memory key under LinuxUsing an USB memory key under Linux Automatic setup based upon version used Mandriva Fedora Core Debian & consort Manual setup Automatic setup based upon version used Follow the procedure below to set up automatically your USB... en.kioskea.net/faq/sujet-702-using-an-usb-memory-key-under-linux
[VB6] Making a form transparent[VB6] Making a form transparent Getting started Restriction In a module As used in a form Getting started Here is a brief explanation on how to use the transparency based upon: The desired format, including controls, according to a... en.kioskea.net/faq/sujet-947-vb6-making-a-form-transparent
Monitor, mouse not working.My computer was working just fine up until a couple of days ago, it was quite out of the blue. We tried to turn it on, and the monitor says "No signal input" and the light remains orange on it, and there is no picture. We tried turning everything off... en.kioskea.net/forum/affich-16872-monitor-mouse-not-working
Red lines on monitorHello, I am Ashlee and I have been facing some problems with my monitor. It has been displaying vertical red-dotted lines on the screen. I tried to restart the computer several times but they are still there. I also verified my monitor connection but... en.kioskea.net/forum/affich-23402-red-lines-on-monitor
Cannot format my hard diskHello, i need to format a hard disk where previously windows vista was to be installed but the installation never finished and now i want to put windows xp on it but i cant do that. i cannot format it if anyone has an idea that would really help me in... en.kioskea.net/forum/affich-24233-cannot-format-my-hard-disk
Download Car Expense TrackerCar Expense Tracker is a budget manager for all modes of transportation: automotive, ship, motorcycle. The user can carry out regular monitoring of costs, fuel, oil level and much more. Simply enter the appropriate data and the application does the... en.kioskea.net/telecharger/telecharger-1295-car-expense-tracker
Download Bank Account TrackingBank Account Tracking is a financial management software designed for professional or personnel. It allows the monitoring of money coming in and leaving your account manager budget allows you to define the expenditure in order of priority. The... en.kioskea.net/telecharger/telecharger-1232-bank-account-tracking
Download Driver TrackMan LiveOn the one elongated, this mouse enough custom design is primarily intended for users with hands that can adapt to this form of mouse or who love the design. Now who is interested, here in direct download the updated driver. en.kioskea.net/telecharger/telecharger-1436-driver-trackman-live
'Friend locator' could become next craze for social networkersA television monitor shows how a new social network site Gypsii, launched this week at the Mobile World Congress, allows users to locate their contacts owing to new technology that uses the mobile phone as a tracking device in Barcelona. Users of... en.kioskea.net/actualites/friend-locator-could-become-next-craze-for-social-networkers-10120-actualite.php3
Linux - Tricks To mount a CD-ROM drive under Linux, log in as the system administrator, i.e. with the login "root". It is then sufficient to mount the drive, i.e. to "capture" the content of the CD-ROM drive in a directory (most of the time /mnt/cdrom/) by typing... en.kioskea.net/linux/linast.php3
Internet - Telnet protocol The Telnet protocol is a standard internet protocol enabling terminals and applications to interface over the Internet. This protocol provides the basic rules making it possible to link a client (system composed of a display and keyboard) to a... en.kioskea.net/internet/telnet.php3
Internet - HTTP Since 1990 HTTP protocol (HyperText Transfer Protocol) has been the most widely used protocol on the Internet. Version 0.9 was only intended to transfer data over the Internet (in particular Web pages written in HTML. Version 1.0 of the protocol... en.kioskea.net/internet/http.php3