Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 555505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:49:17+00:00 2026-05-13T11:49:17+00:00

I am wondering if anyone could provide me with a hint for adding vibration

  • 0

I am wondering if anyone could provide me with a hint for adding vibration to a button’s click event. I have been looking around but only found similar examples using the window registry – however I would prefer avoid toching the registry if possible.

Anyone who could provide me with some sample-code to achieve this (C# or VB.Net)?

Thank you.

UPDATE:
The code provided by jball works like a charm.
I called the code as follows in order to achieve a short vibration:

Private Sub btnMute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _  
handles btnMute.Click
            SetVibrate(1)
            Thread.Sleep(50) 'how long should the vibration last
            SetVibrate(0)
end sub

Works really great!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:49:18+00:00Added an answer on May 13, 2026 at 11:49 am

    It’s accessed through the LED API. From here:

    On most devices the vibration is set
    to LED device 1.

    Here’s the sample code from the same source.

    Private Structure NLED_SETTINGS_INFO
        Public LedNum As Integer
        Public OffOnBlink As Integer
        Public TotalCycleTime As Integer
        Public OnTime As Integer
        Public OffTime As Integer
        Public MetaCycleOn As Integer
        Public MetaCycleOff As Integer
    End Structure
    
    <DllImport("Coredll")> _
    Private Shared Function NLedSetDevice(ByVal deviceId As Integer, ByRef info 
                                                As NLED_SETTINGS_INFO) As Boolean
    End Function
    
    Private Shared Sub SetVibrate(ByVal state As Boolean)
        Dim info As New NLED_SETTINGS_INFO()
        info.LedNum = 1
        info.OffOnBlink = If(state, 1, 0)
        NLedSetDevice(1, info)
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to ASP.NET MVC so wondering if anyone could provide tips on
I was wondering if anyone could possibly provide me some advice on how i
I was wondering if anyone could provide guidance on audio analysis. Analyzing waveforms or
Hello Fellow Matlab Users, I was wondering if anyone could provide me with some
I was wondering if anyone could tell me if what I'm trying to accomplish
I'm wondering if anyone could weigh in on pros and cons of different spelling
I was wondering if anyone could give me an example or point me to
I was wondering if anyone could tell me how to implement line 45 of
I was wondering if anyone could advise on a good pattern for loading textures
I was wondering if anyone could confirm for certain whether SQL Azure supports hierarchy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.