Disable Mouse wheel on Card Forms

victor73victor73 Member Posts: 55
Hello to all,

I have the following issue to resolve in any possible way: during modifications in customer cards in Nav 2009 the users complain about the errors they make when they accidentally use the mouse wheel and without realizing that the customer record has changed they insert values that belog to another customer. :?
So my question: is there a way to avoid mouse wheel scrolling in NAV?
I mean in case you are in a specific form (example customer card) and the user accidentally uses the wheel scroll, the record on the customer form must not change!
Let me know if it's possible or if there are any suggestions by making a customizzed automation or whatsoever
Thank you very much

Comments

  • reijermolenaarreijermolenaar Member Posts: 256
    Hi Victor,

    Add a tablebox and fill the form property TableBoxID.
    Reijer Molenaar
    Object Manager
  • victor73victor73 Member Posts: 55
    Thank you so much
    It works but we have a problem: in that way we disable the next/previous buttons as well, and that doesn't have to happen, I only want to disable the mouse wheel scroll
    Any other suggestions?

    Regrds
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Educate your users. The next time they will ask: "When I'm creating a Sales Order, please disable the reset-button on my PC so I can't accidentally reset my system."

    You can try modifying the registry through code:
    [HKEY_CURRENT_USER\Control Panel\Desktop]
    "WheelScrollLines"="0"
    
    Source: http://technet.microsoft.com/en-us/libr ... 78628.aspx
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • victor73victor73 Member Posts: 55
    Thank you for your response
    I just wanted to know if it was possible or if anybody had any suggestions, if nobody has never done this before, so ok, no problem.
    Then concerning to your suggestion that means disabling the mouse wheel always on any type of application but I didn't ask for that type of suggestion, what I would like should be valid only for NAV.
    However, thank you for your time and if someone has some other suggestions I will appreciate them.
    Regards
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    It was meant to be executed through NAV, to change the registry-setting when the Customer card is opened, and change it back when the customer card is closed. But I agree that, when the user switches to eg. Word or Internet Explorer in between, that the scroll wheel is disabled also.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • victor73victor73 Member Posts: 55
    Well It's not the best and safest solution, but let's suppose I want to implement it
    I wrote the following code but received the error attached, do have any suggestions to correct what I've done wrong?

    //LatmWshShell-Automation-'Windows Script Host Object Model'.WshShell-
    //LvVAR1-Variant--
    //LvVAR2-Variant--
    //LvVAR3-Variant--

    CREATE(LatmWshShell);

    LvVAR1 := 'HKEY_CURRENT_USER\Control Panel\Desktop';
    LvVAR2 := '0';
    LvVAR3 := 'WheelScrollLines';

    //Write
    LatmWshShell.RegWrite(LvVAR1, LvVAR2, LvVAR3);
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    I haven't done it myself, but others have: viewtopic.php?f=23&t=14203
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • victor73victor73 Member Posts: 55
    Thanks, but the link doesn't help so much, can anybody help with the error I received?

    Thanks alot
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    I searched the forum again for you, and came up with this thread: viewtopic.php?f=5&t=25273

    I even created this code to try it out:
    Name	DataType	Subtype	Length
    WshShell	Automation	'Windows Script Host Object Model'.WshShell	
    txtRegKey	Text		1024
    varCurrValue	Variant		
    varNewValue	Variant		
    
    IF ISCLEAR(WshShell) THEN 
      CREATE(WshShell);
    
    txtRegKey := 'HKEY_CURRENT_USER\Control Panel\Desktop\WheelScrollLines';
    varCurrValue := WshShell.RegRead(txtRegKey);
    MESSAGE('Current Value: %1',varCurrValue);
    
    varNewValue := '3';
    WshShell.RegWrite(txtRegKey,varNewValue);
    
    varCurrValue := WshShell.RegRead(txtRegKey);
    MESSAGE('New Value: %1',varCurrValue);
    
    CLEAR(WshShell);
    

    I must have too much time :-$
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • victor73victor73 Member Posts: 55
    Hello Thanks again for your time,
    I tried using your code, I don't receive the errore anymore (thanks again for that), but the mousewheel continues to work, I've tried using values -1,0,1,2 etc.. but nothing never gets disabled..note that I try to disable it on the OnOpenForm trigger and then I able it again in the OnCloseForm
    Did it work for you?
    Thank you
Sign In or Register to comment.