SafeDispatch/Safedispatch_4_0/TabName.cs

68 lines
2.0 KiB
C#
Raw Permalink Normal View History

2024-02-22 16:43:59 +00:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls;
namespace Safedispatch_4_0
{
public partial class TabName : Telerik.WinControls.UI.RadForm
{
public String Name = "";
public String UserName = "";
private Boolean bigsize = false;
private void setLanguage()
{
if (!bigsize)
{
this.Text = MainForm2.returnLNGString("tabName");//newnamex
labelNewTab.Text = MainForm2.returnLNGString("newnamex");
}
else
{
this.Text = string.Format(MainForm2.returnLNGString("geofenceName"),UserName);
labelNewTab.Text = string.Format(MainForm2.returnLNGString("geofencePass"), UserName);
}
}
public TabName(String userName, Boolean bigsize)
{
InitializeComponent();
this.bigsize = bigsize;
UserName = userName;
setLanguage();
if (!bigsize)
radTextBox1.Text = userName;
else
{
this.Width = 310;
radTextBox1.Text = "";
radTextBox1.NullText = string.Format(MainForm2.returnLNGString("enterPassword"), UserName);
radTextBox1.PasswordChar='#';
btOK.Text = "OK";
}
#region THEMING
btOK.ButtonElement.ButtonFillElement.BackColor = MainForm2.ButtonColor;
#endregion
}
private void radTextBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if ((int)e.KeyChar == 13) btOK.PerformClick();
}
private void btOK_Click(object sender, EventArgs e)
{
Name = radTextBox1.Text;
this.DialogResult = System.Windows.Forms.DialogResult.OK;
Close();
}
}
}