ScriptSpot

Forum topic · General Scripting

how to hide text in edittext or dotnet TextBox with dots ?

By alexnguyen · 2017-03-26

Downloads
Description

i create a script and add a key to lock it , everything ok , but i want to hide key with dots ,i think " dotNetObject:System.Windows.Forms.TextBox " can do it , can you help me , thank you very much

Comments (2)

:D

alexnguyen · 2017-03-27

i can do it , thank you very much

`

pixamoon · 2017-03-26

Hi,

It's easy with dotnet TextBox:


TextBox1.PasswordChar = "*"
--or to use dots
TextBox1.UseSystemPasswordChar = True

sample:


rollout a ""
(
	dotNetcontrol c "MaxCustomControls.MaxTextBox"
	
	on a open do 
	(
		c.UseSystemPasswordChar = True
		setfocus c
	)	
)

createDialog a

I don't think maxscript editText has this option. You can try to do it with extra variable to store key/password and function to replace characters with "*". But still there will be a problem to read position of cursor in editText. So I think the easiest option will be to just use dotNetcontrol "MaxCustomControls.MaxTextBox"

Best,
Pixamoon