LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Erasing an Edit String Box in LabWindows

Solved!
Go to solution

When you've exhausted all the possible reasons why it isn't working, the only thing left is the impossible.

 

Hi,

 

First, I am not looking for a LabView answer.  I don't use LabView and don't understand all that visual stuff.  😊

 

I have no problems erasing text boxes.  But I'm using the password instrument and that requires the box to be an text string, not a text box.  ResetTextBox() doesn't work because it's not a text box.  I've tried SetCtrlVal() and SetCtrlAttribute() but I can't get either to put a string into the text string box.

 

I have a suspicion that I'm doing something stupid.  But you know how it is, you look at something for so long that the stupidness isn't apparent.

 

Anyone have an idea?

 

Thanks,

 

Dave

0 Kudos
Message 1 of 7
(3,026 Views)

You want to use the functions in the PasswordControl instrument, specifically PasswordCtrl_SetAttribute().

0 Kudos
Message 2 of 7
(3,005 Views)

Thanks Ian.  I had to find the pwctrl.h file first to see what other functions there are.  There aren't any.

 

So I implemented PasswordCtrl_SetAttribute(mainHandle, MAIN_RPWD, ATTR_CTRL_VAL, rpwd);

 

Where rpwd is the string I want.  Still didn't work.  And I've tried writing the field with the SetCtrlVal() and SetCtrlAttr() functions before converting to password, and the password attr function after converting the control to password.  Nothing works.

 

Thanks again,

 

Dave

0 Kudos
Message 3 of 7
(2,999 Views)
Solution
Accepted by topic author d.

If you are using the password control instrument you should already have all that's needed at hand. FYI the instrument is located in <CVI folder>\toolslib\custctrl: di you loaded the instrument from there? Did you actually loaded the instrument? If so, you should see it listed in Instrument menu in the IDE; clicking on it the Select Function Panel dialog should open where you can find all available functions listed, including PasswordCtrl_SetAttribute



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 7
(2,987 Views)

Hi Robert,

 

Thanks, that is the answer!

 

First, I could find no documentation on pwctrl.  I did find the windows opened when you double click the instrument, but I had no clue how to use them.  But after your comments, I browsed around and found that getting a password control attribute value is ATTR_PASSWORD_VAL, NOT ATTR_CTRL_VAL.  So that was my error.

 

Thanks again,

 

Dave

0 Kudos
Message 5 of 7
(2,970 Views)

Dave, I recommend the Find Function Panel feature (<Ctrl><Shift> P). Assuming the .fp is loaded in your solution, simply putting "password" in that feature will list all your choices.

0 Kudos
Message 6 of 7
(2,961 Views)

Thanks Ian.  Now that I know that's there...

 

Dave

0 Kudos
Message 7 of 7
(2,957 Views)