Question Zoom bug

tester

Member
Joined
Sep 11, 2020
Messages
6
Programming Experience
3-5
I don't know why if I use this function, it reduces drastically the size of the application, like zoom out, but work ok

C#:
     k_push_int = key_label.Text;
            Enum.TryParse(k_push_int, out key_push);
            if (KeyInterop.KeyFromVirtualKey((int)key_push) != 0)
            {
                if (Keyboard.IsKeyDown(KeyInterop.KeyFromVirtualKey((int)key_push)))
                {
                    label3.Text = "1";
                    pressed = 1;
                }
                if (Keyboard.IsKeyUp(KeyInterop.KeyFromVirtualKey((int)key_push)))
                {
                    pushtimerOUT.Enabled = true;
                }
            }
 
With this function, I want to only know when the key is pressed in and out, but it change also the size of the application and I want to avoid this
 
I doubt it is those particular lines of code that shrunk Zoom since those are all read operations. But enabling that timer may be doing something. What does the timer do when it's tick event gets fired?
 
I doubt it is those particular lines of code that shrunk Zoom since those are all read operations. But enabling that timer may be doing something. What does the timer do when it's tick event gets fired?
This is the timerOUT tick function

C#:
private void pushtimerOUT_Tick(object sender, EventArgs e)
        {
            label3.Text = "0";
            pressed = 0;
            pushtimerIN.Enabled = false;
        }

But I try the function without timers and also occur
 
What does KeyInterop.KeyFromVirtualKey() do? It should be just a set of lookup tables/dictionary and maybe some casting. If it does more than that, then that would be an avenue to investigate.

Step through your code in your original post line by line. Which specific line causes Zoom to change size?
 
Oh wait, it is not the Zoom app that you are talking about, but rather your application which is zooming in and out.

Set a breakpoint in your zoom in and zoom out code. Look up the callstack to see what initiated that zoom change.
 
Back
Top Bottom