How to detect mouse clicking in vb.net?

General Tech Learning Aids/Tools 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Learning Aids/Tools related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

I want this program for when user click on something either in application or outside of that, make a screen shot and save it as jpeg to a folder

This is the code that I want put those option in it:

Imports System.Net.Mail

Public Class Form1

Private Function TakeImage()
    Return TakeImage(0, 0, Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height)
End Function

   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    PictureBox1.Image = CType(TakeImage(), Image)
End Sub
End Class

by the way I'm beginner in VB.NET

profilepic.png
manpreet 2 years ago

I guess it is a desktop application and that TakeImage(,,,) works. In your form, add a button, double click it and just call TakeImage from there.
Then there is saving as jpeg - just google on how to convert the bitmap(?) format from TakeImage to jpeg and google how to save it. In VB.Net it should be rather easy to handle files.

But first set a return type on your TakeImage function. Probably like as Image. It doesn't change your program but is good practice and will aid you in your learning as the editor will continuously give you helping feedback.

Happy hacking!


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community