Results 1 to 11 of 11

Thread: [RESOLVED] Touchscreen Does Not Respond to Touch

  1. #1

    Thread Starter
    Member Hypermommy's Avatar
    Join Date
    Dec 2008
    Posts
    50

    Resolved [RESOLVED] Touchscreen Does Not Respond to Touch

    Hi all,

    We have an issue here at work that I've been tasked with finding a solution for and I don't know where to begin. We're running a VB.NET 1.1 application on Windows CE.net 4.2. User input is through a touchscreen. Every now and again (very infrequently) the system will not respond to a touch and will continue to be unresponsive until the system is rebooted. The "welcome screen" (hi there, user, press here to begin kind of thing) has a picturebox (pbWelcome) that runs the entire width and height of the screen and the pbWelcome_Click event is what fires off the whole data collection process. This is the event that I feel is not firing. I know the system is still running because I'm still getting log entries and can even see where they rebooted the system because it was unresponsive.

    My question is this.... I know the actual firing of the click event is beyond my control, right? ( I believe either the VB runtime or Windows would handle that, right?) But is there some way that I could know that the user is trying to touch the screen but it's not responding?

    Thanks! I'm new here (been lurking for a few days) so if I'm saying anything stupid or not giving enough info, please let me know. Thanks in advance for the help!

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Touchscreen Does Not Respond to Touch

    This certainly sounds like a hardware issue, but since it is a touchscreen you have lots of real estate you can work with. Would it be possible for you to have some unobtrusive square on the screen (perhaps a button in flat style with no border and no text) that would change color when touched? If you are doubting that the touches are even working, something like that would give you visual feedback that touch events are being raised. If the button doesn' change color, then the events are not happening.

    Having said that, I wouldn't spend a great deal of time on it, but rather, just do something quick, because if you are having a hardware issue, then you just need to determine that.

    Since you mention a whole bunch of processes, the other possibility is that the whole system is being dragged down for some reason. You might get at that with a small region that is cycling through color. If the color stops cycling, then it isn't just touches that are failing.
    My usual boring signature: Nothing

  3. #3
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: Touchscreen Does Not Respond to Touch

    You'll find you get a better response if you use the MouseDown event instead of the Click event. Don't know why though. But I've run into this type of thing before.
    You'll also get a much faster response if you write you own control and fire a custom event on MouseDown and then pick up the event using a runtime added handler even if the control in question exists during design time; i.e. "AddHandler MyControl.MouseDown..." instead of "...Handles MyControl.MouseDown". Again, I don't know why but it works faster.

  4. #4

    Thread Starter
    Member Hypermommy's Avatar
    Join Date
    Dec 2008
    Posts
    50

    Re: Touchscreen Does Not Respond to Touch

    Thanks guys ... definitely gives me some ideas to try.

    FourBlades, I think I have an idea of how I would add a handler as opposed to using the "handles MyControl.MouseDown", but I'm not 100% sure I understand. Can you point me towards some type of tutorial or something that discusses the two? If not, no big deal... I can google it and see what I find. But if you have something handy I'd appreciate it.

  5. #5
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Sector 001
    Posts
    1,577

    Re: Touchscreen Does Not Respond to Touch

    Are the hardware buttons responding? Your issue can be some mixed up focus thing where the form remains on top but is no longer in focus.
    VB 2005, Win Xp Pro sp2

  6. #6

    Thread Starter
    Member Hypermommy's Avatar
    Join Date
    Dec 2008
    Posts
    50

    Re: Touchscreen Does Not Respond to Touch

    Quote Originally Posted by Half
    Are the hardware buttons responding? Your issue can be some mixed up focus thing where the form remains on top but is no longer in focus.
    No hardware buttons on this unit, but the form not being in focus is something I'll have to figure out how to check because the action (or lack thereof) does fit that scenario... although I don't know how it would lose focus. Definitely something to look at. Thanks.

  7. #7
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Sector 001
    Posts
    1,577

    Re: Touchscreen Does Not Respond to Touch

    Then maybe you can use a timer to bring the form in focus every second or so...if this is the problem of course. Or use a timer to check the focused state and write it to a log.

    A hardware problem is still on the table btw.
    VB 2005, Win Xp Pro sp2

  8. #8

    Thread Starter
    Member Hypermommy's Avatar
    Join Date
    Dec 2008
    Posts
    50

    Re: Touchscreen Does Not Respond to Touch

    Quote Originally Posted by Half
    Then maybe you can use a timer to bring the form in focus every second or so...if this is the problem of course. Or use a timer to check the focused state and write it to a log.

    A hardware problem is still on the table btw.
    I'll do both.. write it to a log first and then bring it back into focus. And yes, I believe it's probably a hardware issue. But it's difficult to convince the engineers of that.

    Thanks for all the help guys! You guys are wonderful!!

  9. #9
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: Touchscreen Does Not Respond to Touch

    Was gone all day...

    Code:
    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            AddHandler Button1.MouseDown, AddressOf OtherPlaceToMonitorButtonOneMouseDown
        End Sub
    
        Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
            'You can monitor for the MouseDown event here
            MessageBox.Show("Handles MouseDown")
        End Sub
    
        Private Sub OtherPlaceToMonitorButtonOneMouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
            'Or you can monitor for the MouseDown event here.
            MessageBox.Show("Added Handler for MouseDown")
        End Sub
    
        Private Sub Form1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus
            'Instead of polling every second or so to see if the form lost focus, 
            'just monitor this event instead.
        End Sub
    
    End Class

  10. #10
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Touchscreen Does Not Respond to Touch

    Quote Originally Posted by FourBlades
    Was gone all day...

    Code:
    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            AddHandler Button1.MouseDown, AddressOf OtherPlaceToMonitorButtonOneMouseDown
        End Sub
    
        Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
            'You can monitor for the MouseDown event here
            MessageBox.Show("Handles MouseDown")
        End Sub
    
        Private Sub OtherPlaceToMonitorButtonOneMouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
            'Or you can monitor for the MouseDown event here.
            MessageBox.Show("Added Handler for MouseDown")
        End Sub
    
        Private Sub Form1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus
            'Instead of polling every second or so to see if the form lost focus, 
            'just monitor this event instead.
        End Sub
    
    End Class
    From the documentation for the LostFocus event:
    The GotFocus and LostFocus events are low-level focus events that are tied to the WM_KILLFOCUS and WM_SETFOCUS Windows messages. Typically, the GotFocus and LostFocus events are only used when updating UICues or when writing custom controls. Instead the Enter and Leave events should be used for all controls except the Form class, which uses the Activated and Deactivate events. For more information about the GotFocus and LostFocus events, see the WM_SETFOCUS and WM_KILLFOCUS topics in the "Keyboard Input Reference" section of the Platform SDK Documentation in the MSDN library at http://msdn.microsoft.com/library.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  11. #11
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: [RESOLVED] Touchscreen Does Not Respond to Touch

    Good info, jm, thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width