WolfDen133
WolfDen133
CC#
Created by WolfDen133 on 10/31/2024 in #help
Winforms control not updating on window resize
its absolutely fine if i update the lil mufu any other way, but resize, NAH
6 replies
CC#
Created by WolfDen133 on 10/31/2024 in #help
Winforms control not updating on window resize
Code the code i have for it
6 replies
CC#
Created by WolfDen133 on 10/31/2024 in #help
Winforms control not updating on window resize
public void DoResize ()
{
int height = Loader.MainWindow.Toolbar.Height - 6;
int width = (int)(Loader.MainWindow.Toolbar.Width / 4.85f);

Top = 3;
Height = height;
Width = Math.Min(width, 400);

iconPanel.Width = Height - 6;
iconPanel.Height = Height - 8;
iconPanel.Left = (ClientSize.Width - (iconPanel.Width + 3));

titlePanel.Left = titlePanel.Top = 3;
titlePanel.Width = Width - iconPanel.Width - 12;
titlePanel.Height = (height / 2);

title.Font = Utils.Font.GetHandleFont((titlePanel.Height / 2) - 5);
title.Width = titlePanel.Width;

version.Left = title.Width;
version.Font = Utils.Font.GetHandleFont(Math.Min(title.Font.Size - 3, 12));
version.Top = title.Height - version.Height - (int)(title.Height / 8f);

author.Top = title.Height;

author.Font = Utils.Font.GetHandleFont(Math.Min(title.Font.Size - 3, 12));

author.Left = (int)(author.Font.Size / 2f);
}
public void DoResize ()
{
int height = Loader.MainWindow.Toolbar.Height - 6;
int width = (int)(Loader.MainWindow.Toolbar.Width / 4.85f);

Top = 3;
Height = height;
Width = Math.Min(width, 400);

iconPanel.Width = Height - 6;
iconPanel.Height = Height - 8;
iconPanel.Left = (ClientSize.Width - (iconPanel.Width + 3));

titlePanel.Left = titlePanel.Top = 3;
titlePanel.Width = Width - iconPanel.Width - 12;
titlePanel.Height = (height / 2);

title.Font = Utils.Font.GetHandleFont((titlePanel.Height / 2) - 5);
title.Width = titlePanel.Width;

version.Left = title.Width;
version.Font = Utils.Font.GetHandleFont(Math.Min(title.Font.Size - 3, 12));
version.Top = title.Height - version.Height - (int)(title.Height / 8f);

author.Top = title.Height;

author.Font = Utils.Font.GetHandleFont(Math.Min(title.Font.Size - 3, 12));

author.Left = (int)(author.Font.Size / 2f);
}
6 replies
CC#
Created by WolfDen133 on 10/31/2024 in #help
Winforms control not updating on window resize
private void MainWindow_ResizeEnd (object sender, EventArgs e)
{
if (!Visible) return;

SuspendLayout();
Toolbar.DoResize(); // Code to resize the element
ViewManager.GetSelectedView().OnResize();

Toolbar.Invalidate(); // Update it visually
Toolbar.Update(); // And update the element
ResumeLayout();
}
private void MainWindow_ResizeEnd (object sender, EventArgs e)
{
if (!Visible) return;

SuspendLayout();
Toolbar.DoResize(); // Code to resize the element
ViewManager.GetSelectedView().OnResize();

Toolbar.Invalidate(); // Update it visually
Toolbar.Update(); // And update the element
ResumeLayout();
}
6 replies
CC#
Created by WolfDen133 on 10/31/2024 in #help
Winforms control not updating on window resize
It only updates after I move the window
6 replies
CC#
Created by WolfDen133 on 4/21/2024 in #help
touch input winforms
Please help
8 replies
CC#
Created by WolfDen133 on 4/21/2024 in #help
touch input winforms
using .net7.0 framework, expecting to see code 576, but seeing stream of:
33
132
132
528
587
33
282
528
33
33
132
132
528
587
33
282
528
33
when touching and reliecing the screen
try
{
// Registering the window for multi-touch, using the default settings.
// p/invoking into user32.dll
if (!RegisterTouchWindow(this.Handle, 0))
{
Debug.Print("ERROR: Could not register window for multi-touch");
}
}
catch (Exception exception)
{
Debug.Print("ERROR: RegisterTouchWindow API not available");
Debug.Print(exception.ToString());
MessageBox.Show("RegisterTouchWindow API not available", "MTScratchpadWMTouch ERROR",
MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, 0);
}
try
{
// Registering the window for multi-touch, using the default settings.
// p/invoking into user32.dll
if (!RegisterTouchWindow(this.Handle, 0))
{
Debug.Print("ERROR: Could not register window for multi-touch");
}
}
catch (Exception exception)
{
Debug.Print("ERROR: RegisterTouchWindow API not available");
Debug.Print(exception.ToString());
MessageBox.Show("RegisterTouchWindow API not available", "MTScratchpadWMTouch ERROR",
MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, 0);
}
register code (no error messages shown when registered
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
// Decode and handle WM_TOUCH message.
bool handled;
Console.WriteLine(m.Msg);
switch (m.Msg)
{
case WM_TOUCH:
handled = DecodeTouch(ref m);
break;
default:
handled = false;
break;
}

// Call parent WndProc for default message processing.
base.WndProc(ref m);

if (handled)
{
// Acknowledge event if handled.
m.Result = new System.IntPtr(1);
}
}
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
// Decode and handle WM_TOUCH message.
bool handled;
Console.WriteLine(m.Msg);
switch (m.Msg)
{
case WM_TOUCH:
handled = DecodeTouch(ref m);
break;
default:
handled = false;
break;
}

// Call parent WndProc for default message processing.
base.WndProc(ref m);

if (handled)
{
// Acknowledge event if handled.
m.Result = new System.IntPtr(1);
}
}
override code, I have no idea why its not reporting the message
8 replies
CC#
Created by WolfDen133 on 4/21/2024 in #help
touch input winforms
have any idea tho?
8 replies
CC#
Created by WolfDen133 on 4/21/2024 in #help
touch input winforms
there ya go
8 replies