How do i set Border properties on a TextBox Control in Winforms so that It displays sunken borders? Any ideas?
Thanks
How do i set Border properties on a TextBox Control in Winforms so that It displays sunken borders? Any ideas?
Thanks
You need to remove the Application.EnableVisualStyles()
call from your Program.cs file.
Unusual request. But you can do it by selectively disable the theming for the control. Add a new class to your project and paste the code shown below. Compile. Drop the new control from the top of the toolbox onto your form.
using System;
using System.Windows.Forms;
class SunkenTextBox : TextBox {
protected override void CreateHandle() {
base.CreateHandle();
SetWindowTheme(this.Handle, "", "");
}
[System.Runtime.InteropServices.DllImport("uxtheme.dll")]
private static extern void SetWindowTheme(IntPtr hWnd, string appname, string idlist);
}