Hide Input in a custom textbox Visual basic - vb.net

I am using a custom theme which includes a Textbox, and I want to use this to get a password input.
In order to do do that I want the input to be hidden like a regular password input. In a normal textbox I would use the password char option but this one doesn't have it. Can I make the option myself?

If this custom control class inherits the TextBox class, it should also inherit the password character behavior. Have you tried setting it even though you don't "see" it as an option?
If this class was built from scratch (not inherited fromTextBox), you can manually create the effect of a password character by modifying one of its keyboard events (e.g. KeyPress) or TextChanged, if that exists. Your will need to declare a variable for the password, update it appropriately as the user types, and then change the Text of your custom control to a string of password characters the same length as your variable.
If you still can't get your control working, please post the code for the custom class, what you have tried, and the specific problems you encounter when you try each approach.

Related

Add custom control to toolbox and have its properties show up in the properties window

To illustrate what I'm asking, let's say I have a custom TextBox that has 2 modes. Mode 1 only allows numbers, and mode 2 only allows dates in a particular format.
Using a class module I can create this custom TextBox, and I can use a loop when the userform initialises to set which TextBoxes are custom.
What I'd like to happen is have the custom TextBox, or what ever custom control I want, show up in the toolbox. And I also want its custom properties, if they exist, to show up in the property window.
So far, I've been unable to find a way to do this. In fact, I've been unable to find out if it's even possible. It seems, to me anyway, that it's something that should be possible, but maybe I'm barking up the wrong tree. If it's possible I'd really appreciate being pointed to a resource.

Capital Only Edit Control

Having a bit of a problem doing this and not sure of it can be done. I have an edit control that a user types into, I would like for the input to be all in capital letters. I tried having a custom action on the edit control to get the property, convert to capital letters and set the property again each time a letter is set but it does not work. I guessed it wouldn't but no harm in trying..:)
Has anyone else solved this? I would like to do it without having a button to press if possible. The dialog in question is a twin dialog if that helps at all.
Thanks for your help
It's not possible using the native built-in Windows Installer UI. The underlying MaskedEdit Control is primitive. There are no events to tie into to validate and modify as the characters are entered. You can only ToUpper() the property when the user clicks Back or Next.
The alternative would be to go with an external UI handler which is a lot of learning and work.

Impose specific input method

In an application I want to have a text field where the input method always should be handwritten simplified chinese, even though the user probably haven't even activated this input method in the settings.
Is there a way to impose a specific input method?
UITextField has a property inputView which can be used for a custom input view, can also existing input methods' views be grabbed and set as inputView?
The answer is that it's not possible, as phix23 wrote in a comment. The only option would be to create my own custom input view.

Interface Builder NSStaticText value needs to be updated every time anything changes in dialog

I have a modal dialog thats building a string. The string is shown to the user, and the user presses checkboxes, radio boxes, etc to build the string. The string exists nowhere - I build it for display in -()builtString; from the configuration of the self.valuesDict.
I can easily wire up the checkboxes via bindings in IB: for example to the files owner (the controller) with self.valuesDict.checkbox1
Also I bound the display of the string to "self.builtString".
But every time any checkbox changes, I want to redisplay the string that's shown to the user.
If I abandon bindings, then I think I can use the [self willChangeValueForKey:#"builtString"], for each checkbox, etc, I think, but that is some messy looking code by the time I deal with them all.
So how do you tell a nstextfield in IB to update every time say self.valuesDict changes?
Thanks for any comments/suggestions.
--Tom
You can specify dependencies between bindings. Just write a class method +(NSSet*) keyPathsForValuesAffectingBuiltString that returns a set with all key paths of properties builtString depends on. Then things bound to your string will also be updated when one of the other properties is changed. For more details and step-by-step instructions you can look at this article.

How do I obfuscate password input on a form using vb.net?

I'm not sure how to obfuscate input on a form when accepting password entry using vb.net. Rather than echoing the password, I just want to echo asterisks, like this:
Actual password input:
swordfish
What the user sees:
*********
How do I accomplish this?
Set the PasswordChar property of a textbox to the character *, eg.
textBox.PasswordChar = "*"c
The problem with typpo and jon's answer is the textbox input based on PasswordChar property is that it is insecure! Select the text masked by asterisks, copy it to the clipboard and paste it into say, notepad for an example, the password is revealed!
See here for an article explaining how to protect it, and also here,
The first link is written in VC, ok, it is not in the language of your choice, but it will highlight how to get around password revealers that can unmask the password input. The second link is in C# which shows how to ensure a user has selected/entered a password based on the strength of the input.
Those two links should help you in the direction in
Technique in securing the password input to hide it from simple clipboard operations or even password revealer programs.
Technique in determining the strength of the password.
Using both can help you in ensuring your password input is secure enough and to keep the end-user and management alike, feeling confident that the set up is indeed secure in relation to password inputs.
In a VB form? I think you set the PasswordChar property to a character, it will show password chars.
If in a webform, set textbox.textmode to password.