A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

21 lines
690 B

using System;
using System.Text;
using Avalonia.Platform;
namespace IntegrationTestApp.Embedding;
internal class Win32TextBoxFactory : INativeControlFactory
{
public IPlatformHandle CreateControl(IPlatformHandle parent, Func<IPlatformHandle> createDefault)
{
var handle = WinApi.CreateWindowEx(0, "EDIT",
@"Native text box",
(uint)(WinApi.WindowStyles.WS_CHILD | WinApi.WindowStyles.WS_VISIBLE | WinApi.WindowStyles.WS_BORDER),
0, 0, 1, 1,
parent.Handle,
IntPtr.Zero,
WinApi.GetModuleHandle(null),
IntPtr.Zero);
return new Win32WindowControlHandle(handle, "HWND");
}
}