如何在datadridview中创建类型密码列

如何在datadridview中创建类型密码列

本文介绍了如何在datadridview中创建类型密码列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么会出现此错误?columnIndex中的错误

错误 -

System.Windows.Forms.DataGridViewEditingControlShowingEventArgs不包含ColumnIndex的定义,也没有扩展方法ColumnIndex接受可以找到System.Windows.Forms.DataGridViewEditingControlShowingEventArgs类型的第一个参数(你是否缺少using指令或程序集引用?)









why this error happening here?errors in columnIndex
Error -
System.Windows.Forms.DataGridViewEditingControlShowingEventArgs does not contain a definition for ColumnIndex and no extension method ColumnIndex accepting a first argument of type System.Windows.Forms.DataGridViewEditingControlShowingEventArgs could be found (are you missing a using directive or an assembly reference?)




private void dtvregister_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
       {

           if (e.ColumnIndex == 2)
           {
               TextBox tb = e.Control as TextBox;
               if (tb != null)
               {
                   tb.PasswordChar = '*';
               }
           }


       }





什么我试过了:



i创建了密码文本框,并将文本归档为使用系统密码..我需要在datagridview中隐藏密码字符,或者我需要在datagridview中加密,这可能吗?请给我解决方案..谢谢



What I have tried:

i have created password textbox and used text filed as 'use system password'.. i need to hide password character in datagridview,,or i need to encrypt in datagridview,, is it possible? plz give me solution.. thank you

推荐答案


这篇关于如何在datadridview中创建类型密码列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 15:05