how to automatically include characters in textbox - vb.net

how to automatically include alphabetic characters in a text box based on the selection from combo box in vb.net,leaving the other spaces for the user to enter .say the text box contains 8 characters (eg. 117CS227 ).the CS in text box must automatically include leaving the remaining first and last three spaces for the user to enter in the text box.this text should automatically include based on the selection from combo box.
eg say there are three selections from combo box (computers ,biology,maths) . if the user selects computers then the text box below the combo box must include cs in them and for biology and maths ,they should include bg and ms respectively in the text box.
(the text box and combo box are in the same form)

Related

Using 1 combo box as a lookup for another comb box on second sheet

I have 2 sheets, the first has 2 combo boxes the second has 3. I am making a macro button that will look at the Sheet1's combo boxes and basically v-lookup an select those fields in Sheet2's combo boxes.
Combo boxes on both sheets have the same drop downs items, but I do not want this to happen automatically (so not just linking the two).
I have found a number of posts for copying into the combo box (like code below), but not just sorting/selecting. Is this possible? If so any easy way to do it?
Worksheets("Sheet1").DropDowns("Boxname1").Copy Destination:=Sheets("Sheet2").Range("E1")
Simply use:
Worksheets("Sheet2").DropDowns("Boxname2").Value = Worksheets("Sheet1").DropDowns("Boxname1").Value
in the change macro.

Set text box value in Word VBA

I have a Word 2010 form template with various text boxes, combo lists and radio buttons. I wish to take the value from one text box and insert it as the value of another text box when a Save button is invoked. I have extracted the value from the source text box with the code below but how do I then insert it as the value of the target text box? I have tried a few things including the reverse of the code below but so far without success.
srp = ActiveDocument.SelectContentControlsByTag("RPI").Item(1).Range.Text
The Range.Text property is read/write. So you use the exact reversal of the code you have.
srp = ActiveDocument.SelectContentControlsByTag("RPI").Item(1).Range.Text ' Read
ActiveDocument.SelectContentControlsByTag("SRP").Item(1).Range.Text = srp ' Write

How to copy certain line with specific word from a Richtextbox into another Richtextbox?

I have a Richtextbox with many words in each line.
Here's the layout:
When I click the "FILTER DATA" button, let says Button2, I want it to copy sentences on certain line from Richtextbox1 on the left side to the Richtextbox2 on the right side, which contains specific keyword that I input in the Textbox1 at the middle top of the form.
For Example, when I type "1" in the KEYWORDS textbox, the button will copy sentences of line 1 and 10 into Richtextbox2.

Cocoa Application Display Combo Box with a format based on Text Field input

I am new to Mac application. I have form in which there is a combo box and text field. User can enter text values, and based upon the text input value, the combo box value need to be changed. i.e., the data source of combo box will be updated each time, when the text input changes. The combo box lists various formats with dd_mm_yyyy_textfieldinputname, mm__dd_yyyy_textfieldinputname, textfieldinputname_dd_mm_yyyy etc.
Can I do this using objective C. i.e., here the Combobox input changes based on the values of user input text field dynamically.

How do I make my program in VB show the number of letters in a text box, into a tab box?

I'm making a program whereby it takes text and 'encrypts' it. I managed to do the caeser cypher part, but another part was to get the string value in the encrypted text, and display the number of characters in it. I decided to get the text from a text box, and display it in a tabcontrol box. What would be the code to get the values from the textbox, list what they are, and how many times they appear in the text box?
use this code below; will gets you the character length in your textbox
TextBox1.TextLength