setting textbox text equal to textbox text on a different form? - vb.net

is it possible in design mode to set the textbox text property to the text property of a textbox in a different form in vb.net?

You could use the ApplicationSettings.PropertyBinding property of the text box to accomplish what you want. If you sort the text box properties A-Z, it should be the first one in the list in parenthesis. Just create a shared application value and it will apply to each control that binds to the value.

Related

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

Difference between Combobox properties SelText and Text?

I don't quite understand the differences between the combobox properties SelText and Text.
If I want to send the content of a combobox as a parameter to another procedure, should I send .text or .selText?
If I want to make enter text into a combobox using a macro, should I write the text in .selText or .Text?
The difference is really given in the name (SelText vs. Text) where Sel stands for Selected. One is used to return or modify the selected text (i.e. SelText) and the other is used to return or modify the entire text (i.e. Text).
If no text is selected in the ComboBox then they return and modify the same value.
I suspect you want to use Text unless you are specifically interested in the selected text.
This appears to be consistent for an ActiveX control on a Worksheet or for a control on a User Form.

Is their any CharacterUpDown Control in vb.net

In VB Win-forms Application a NumericUpDown Control is used for only to scroll numbers. Its definition is:
The Windows Forms NumericUpDown control looks like a combination of a text box and a pair of arrows that the user can click to adjust a value. The control displays and sets a single numeric value from a list of choices. As Shown here.
I want to use strings instead of numeric values. For example, Grades: "A","B","C", etc. I think I will need to use UserContorl to code another custom "StringUpDown" Control.
You can't add String values to Numeric Drop down. instead for this you can use DomainUpDown here is the code to place a DomainUpDown in your form that contains A - Z characters
Dim domainUpDown1 As DomainUpDown
domainUpDown1 = New System.Windows.Forms.DomainUpDown()
For i As Integer = 65 To 90
domainUpDown1.Items.Add(Chr(i))
Next
Controls.Add(domainUpDown1)
Note : This control is available in Tool box also
You can change values using the ByRef=""
e.g. RefValues="Red;Blue;Green;Brown"
Hope this is what you were looking for
Link: mindStick

hiding a textbox if text value is null

I have done a research on this but can't seem to find a convincing answer. Here is the scenario. I am doing a reporting application in rdlc. I am getting field values from my database and displaying in the text boxes. Please see below what I display in the report
Textbox1
Textbox2
Textbox3
In case the value of text box 2 or any other text box is null, I don't display the same using the formular
iif(fields!Textbox2.value is nothing, false, true)
for example this is what I get
Textbox1
Textbox3
with a space between textbox1 and textbox3. I dont want this space to appear incase the value is null. How can I handle this? Thank you
If you're using a simple TextBox you have to set Visibility and CanShrink property.
If you're using a TextBox in a Table/Tablix you have to set Visibility property of the entire TableRow containing the TextBox.

Showed text in a NSComboBox with Cocoa

I'm adding an object to a ComboBox using this code :
Ploofed *uped = [Ploofed initwithImageAndURL:(NSImage *)myImage :(NSString *)returnString];
[_OldTrans addItemWithObjectValue:(id)uped];
[_OldTrans selectItemWithObjectValue:(id)uped];
But there is only a blank line in the ComboBox List, how do I set the text of the added object ?
From Apple's docs on combo boxes (Introduction to Combo Boxes):
When you set or retrieve a combo box’s value with the standard NSControl methods (such as setStringValue:, stringValue, setFloatValue:, and floatValue), you’re setting or retrieving the value of the combo box’s text field, and not the current selection of the list. Programmatically changing the combo box’s value does not change what’s selected in the combo box’s list. Conversely, programmatically changing what’s selected in the list does not change the text field’s value. If you want the text field value and the list selection to match up, you need to set them individually.
For example, say you want to initialize the combo box’s list and text field to the list’s third item. This code does that for a combo box that maintains an internal item list:
[myComboBox selectItemAtIndex:2]; // First item is at index 0
[myComboBox setObjectValue:[myComboBox objectValueOfSelectedItem]];