Answers for "c# textbox tab column"

C#
0

c# textbox tab column

[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg,
    Int32 wParam, int[] lParam);
private const uint EM_SETTABSTOPS = 0xCB;

// Set tab stops inside a TextBox.
private void SetTextBoxTabs(TextBox txt, int[] tabs)
{
    SendMessage(txt.Handle, EM_SETTABSTOPS, tabs.Length, tabs);
}
Posted by: Guest on February-28-2020
0

c# textbox tab column

// Set tab stops inside a ListBox.
private void SetListBoxTabs(ListBox lst, IEnumerable<int> tabs)
{
    // Make sure the control will use them.
    lst.UseTabStops = true;
    lst.UseCustomTabOffsets = true;

    // Get the control's tab offset collection.
    ListBox.IntegerCollection offsets = lstCars.CustomTabOffsets;

    // Define the tabs.
    foreach (int tab in tabs)
    {
        offsets.Add(tab);
    }
}
Posted by: Guest on February-28-2020

C# Answers by Framework

Browse Popular Code Answers by Language