本文整理汇总了C#中System.Windows.Forms.LabelEditEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# LabelEditEventArgs类的具体用法?C# LabelEditEventArgs怎么用?C# LabelEditEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LabelEditEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了LabelEditEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: categories_AfterLabelEdit
private void categories_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
if (categories.Items[e.Item].Text != "" && e.Label == null) return;
string label = null;
if (e.Label != null) label = e.Label.Trim();
if (e.Label == null || e.Label == "")
{
if (add_mode)
{
source.RemoveAt(selected_cat);
categories.Items.RemoveAt(categories.Items.Count - 1);
add_mode = false;
}
else
{
MessageBox.Show("Name can not be Empty!");
e.CancelEdit = true;
}
}
else
{
source[selected_cat].name = label;
if (add_mode)
{
add_mode = false;
selected_cat = -1;
categories.SelectedIndices.Clear();
categories.SelectedIndices.Add(categories.Items.Count - 1);
select_category();
}
}
}
示例2: ArgumentsList_BeforeLabelEdit
private void ArgumentsList_BeforeLabelEdit(object sender, LabelEditEventArgs e)
{
if(e.Item == ArgumentsList.Items.Count - 1)
{
e.CancelEdit = true;
}
}
示例3: ArgumentsList_AfterLabelEdit
private void ArgumentsList_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
if((e.Label == null && ArgumentsList.Items[e.Item].Text.Length == 0) || (e.Label != null && e.Label.Trim().Length == 0))
{
e.CancelEdit = true;
ArgumentsList.Items.RemoveAt(e.Item);
}
}
示例4: listView_AfterLabelEdit
void listView_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
if (e.Label != null)
{
assemblyListManager.Rename(listView.Items[e.Item].Text, e.Label);
assemblyListManager.CurrentListName = e.Label;
}
}
示例5: listView_AfterLabelEdit
private void listView_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
if (treeView.SelectedNode.Level == 0)
{
//SelectedAlbum[e.Item].Name = e.Label;
//FillTreeView();//TODO: Mejorar esto
}
}
示例6: lvwCategories_AfterLabelEdit
private void lvwCategories_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
if (e.Label == string.Empty)
{
e.CancelEdit = true;
}
PopulateListView();
}
示例7: OnUIASubItemTextChanged
internal void OnUIASubItemTextChanged (LabelEditEventArgs args)
{
//If our index is 0 we also generate TextChanged for the ListViewItem
//because ListViewItem.Text is the same as ListViewItem.SubItems [0].Text
if (args.Item == 0)
OnUIATextChanged ();
if (UIASubItemTextChanged != null)
UIASubItemTextChanged (this, args);
}
示例8: lvConnects_AfterLabelEdit
void lvConnects_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
//throw new NotImplementedException();
Data.Connect c=(Data.Connect)(lvConnects.Items[e.Item].Tag);
if (e.Label != null)
{
c.Name = e.Label;
propertyGrid1.SelectedObject = c;
}
}
示例9: lvUserGroup_AfterLabelEdit
//结束编辑组
void lvUserGroup_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
ListViewItem lvt = lvUserGroup.Items[e.Item];
if (string.IsNullOrEmpty(e.Label) || e.Label == lvt.Text) { e.CancelEdit = true; return; }
//编辑
Cache.ControlCache.RemoveUserGroup(lvt.Text);
Cache.ControlCache.UserGroupList.Add(e.Label);
Env.ClientConfig.HostGroupConfig.Where(m => m.Value == lvt.Text).ToList().ForEach(m => Env.ClientConfig.HostGroupConfig[m.Key] = e.Label);
lvt.Text = e.Label;
}
示例10: algoListView_AfterLabelEdit
private void algoListView_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
if (e.Label == null)
//edit was canceled
return;
string algorithmName = SelectedAlgorithmName();
CoinAlgorithm algorithm = MinerFactory.Instance.GetAlgorithm(algorithmName);
algorithm.Name = e.Label;
algorithm.FullName = e.Label;
}
示例11: listView1_AfterLabelEdit
private void listView1_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
SqlConnection conn = new SqlConnection(login.sqlName);
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "new_教师课程_课时修改名称";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("newName", SqlDbType.NVarChar).Value = e.Label.ToString();
cmd.Parameters.Add("keshiID", SqlDbType.Int).Value = listView1.FocusedItem.Tag;
cmd.ExecuteNonQuery();
conn.Close();
listView1.LabelEdit = false;
}
示例12: ProfilesListViewAfterLabelEdit
private void ProfilesListViewAfterLabelEdit(object sender, LabelEditEventArgs e)
{
_renameInProcess = false;
// If we cancel rename operation by hitting 'Esc' then label is null
if (!string.IsNullOrEmpty(e.Label))
{
_settingsManager.RenameProfile(_originalProfileName, e.Label);
// Reload profiles information
PopulateProfilesList();
}
}
示例13: listCategories_AfterLabelEdit
private void listCategories_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
if (listCategories.SelectedItems != null && listCategories.SelectedItems.Count > 0 && e.Label.Trim() != null)
{
if (Categories.Local.FirstOrDefault(c => c.Title == textAddCategory.Text.Trim()) == null)
(listCategories.SelectedItems[0].Tag as Category).Title = e.Label.Trim();
else
{
MessageBox.Show("Category name exist");
e.CancelEdit = true;
}
}
}
示例14: paramListView_AfterLabelEdit
private void paramListView_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
if (this.ViewableItem == null || e.Label == null) return;
ListViewItem item = this.paramListView.Items[e.Item];
string type = item.SubItems[2].Text;
switch (type)
{
case "Single":
float floatResult;
if (float.TryParse(e.Label, NumberStyles.Any, CultureInfo.CurrentCulture, out floatResult))
{
ViewableItem.Parameters[e.Item] = floatResult;
e.CancelEdit = false;
}
else
{
MessageBox.Show("Invalid entry, expecting a " + type, "Invalid input", MessageBoxButtons.OK, MessageBoxIcon.Error);
e.CancelEdit = true;
}
break;
case "Int32":
int intResult;
if (int.TryParse(e.Label, out intResult))
{
ViewableItem.Parameters[e.Item] = intResult;
e.CancelEdit = false;
}
else
{
MessageBox.Show("Invalid entry, expecting a " + type, "Invalid input", MessageBoxButtons.OK, MessageBoxIcon.Error);
e.CancelEdit = true;
}
break;
case "Boolean":
bool boolResult;
if (bool.TryParse(e.Label, out boolResult))
{
ViewableItem.Parameters[e.Item] = boolResult;
e.CancelEdit = false;
}
else
{
MessageBox.Show("Invalid entry, expecting a " + type, "Invalid input", MessageBoxButtons.OK, MessageBoxIcon.Error);
e.CancelEdit = true;
}
break;
default:
break;
}
}
示例15: lstNPCNames_AfterLabelEdit
private void lstNPCNames_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
if (e.Label == null) // User made no changes to the label text
return;
NPCInfo NI = this.lstNPCNames.Items[e.Item].Tag as NPCInfo;
if (NI != null) {
string NewName = e.Label;
if (NewName.Length > 0x18) {
NewName = NewName.Substring(0, 0x18);
this.lstNPCNames.Items[e.Item].Text = NewName;
}
NameChange.Add(NI.ID, NI.Name, NewName);
NI.Name = NewName;
}
}