.net - Set The Value Of A Textbox Based On The Value Of A 2nd Text Box?
Aug 20, 2010
I have a textbox which can be left blank or contain a date. If the textbox has a date I want the 2nd textbox's value to be set to the value of a session variable. I need this to happen before the update sql is performed on postback.
When a SelectedIndex in a ListBox is changed I would like a textbox below the listbox that gives a description to be populated with the value from a description field in SQL.I have the following code so far, but I get an error that says "Must declare the scalar variable "@ReportName"
I just want to open a form based on a users input into the textbox
Public Class MainForm
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TagBox1.Click Form2.Show()
[CODE]....
I already have it opening the form2 based on a click from the picture, but decided aginst that design. Also any design on form2? (below) I am storing values for tags inside the forms....
Public Class Form2
Private Sub saveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles saveButton.Click My.Settings.SaveTitle = TextBox1.Text
I want a textbox to have autocomplete. I want the completion to be based off of text that has been previously entered into the textbox. My method of saving seems to work but when i close the program and re run it the autocomplete suggestions arent there anymore.
This is the only way I know how to obtain the info I need for this equation but if generated again with no input from the textboxes I get an error. Is there anyway to bypass this if its generated a second time with no inputs?
I'm quite new to VB.net (and VS 2008), so I'm afraid my question might be basic, but I'm not sure how to solve it.I have a winform with three textbox fields and a button. All textbox fields must be filled before the user can click the button to continue. To this end I would like to disable the button as long as there is at least one empty textbox.
If I had only one textbox field, it would be easy for me to do. In the Textbox1_Leave event I would check if Textbox1.Text is not empty and if so, set Button1.Enabled = True.But what should I do if I have three textboxes? Have three event handlers, one for each textbox? Or is there a way I'm not familiar with?
Lets see if I can explain-I have a text box (rich text box) in a form. Inside the box, some data gets put in there- specifically insurance information.
Normally, the box doesn't need to change color to alert the user there's a problem with the text that's inside, because the information is usually good.But there are a few phrases that need to alert the user there's a problem.
For example, if the words "Not Found AS OF:" appear anywhere in the box, I need the background to show red.Or, if the words "Letter #1" appear in the box, it needs to show red. Absent of any key words, the box is normal (white).
I have a text box (rich text box) in a form. Inside the box, some data gets put in there- specifically insurance information.Normally, the box doesn't need to change color to alert the user there's a problem with the text that's inside, because the information is usually good.But there are a few phrases that need to alert the user there's a problem.For example, if the words "Not Found AS OF:" appear anywhere in the box, I need the background to show red. Or, if the words "Letter #1" appear in the box, it needs to show red. Absent of any key words, the box is normal (white).[code]
I have a form with a few text boxes, one of which has it's contents stored to a integer variable.
The value stored will end up being one of a few numbers ranging from 12 to 98, and I need to the same number of new variables as the number in the textbox.
Can I automate the creation of new variables based on the value stored, or do I need to define the max number required and just ignore the rest when using less?
in short I just want to have constantly running in the background something to display in LB8 the the contents of LB 2 that contain what is typed in TB1
1Private Sub Name_Change_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load 2Dim filtertext As Integer 3filtertext = ListBox2.FindString(TextBox1.Text) 4ListBox8.Items.Add(filtertext) 5End Sub
I have a windows form that imports data from an xls file to sql2005. I have a browser button, a dropdown list for the sheet names in excel and a process button. Now the excel file has 3 sheets (sheet1, sheet2, sheet3) the columns and data type are not the same so I need 3 different queries to access this file,
I think about CASE, but not very sure, So if dropdown list.selectedvalue=sheet1 then run code
i am trying to insert/save the listview item/s on the database.what i am trying to do now is if the product is being entered/saved for the first time.the fcode should be 1, and increments after that.i have a combo box and a text box.the combo box items are from the database [ product table ]
I have created a Scada System in Visual Basic 2010 In this system , its display the radial Gate position of hydro power plant. i have the analog value of particular signal in a textbox which use for gate position. how can i make the radial Gate animation in this VB based scada system. Or i have a gate opening and closing video of gate. Is it possible to control the video from textbox values so that i can show the gate position at the particular analog value..
i have a login form that works ok. but i need to insert a textbox in it that has to be filled with the real username based on combobox selection. following the code for the login window. That code works OK.
Dim conn_login As SqlClient.SqlConnection conn_login = New SqlClient.SqlConnection() conn_login.ConnectionString = "Data Source=SQL;Initial Catalog=orcamento;Persist
I have a form, frm1 w/a combobox, cboLocations, which is being populated using a sql string. There is also a frm2 w/a series of textboxes and other comboboxes. I want it so that once a selection is made from cboLocations, the textboxes and comboboxes on frm 2 are populated with the corresponding data. Here is what I have so far:
frm1: Public Class frmLocations Dim conn As New SqlConnection("Data Source=f03d3s-dev01; Initial Catalog=dos_track;User Id=vbuser; Password=tran3;") Dim depot_refnbr As Integer Private Sub frmLocation_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load conn.Open() [Code] .....
What's happening right now is that I make a selection from cboLocations on frm1 and click on the OK button, frm2 loads, but none of the textboxes are populating and one of the comboboxes, cboDepot, shows the different data when you click on the down arrow, but it's not displaying anything it its text field when frm2 loads.
I have one table here with a list of UserIDs, Users, and ClientCodes.Each user can be assigned a client code to view that client's data else where.Right now I have to change it for everyone via SQL Server and actually going into the table manually, but I'm trying to make a simple little program that will let the user change it themselves.All I need is a textbox that pulls the user based on a certain UserID from the table, and a drop down list that will not only show the current ClientCode they're set to, but allow me to change it and save that change to the table in the database.What's the best way to go about this? I tried using the wizards but I guess that's not the best way to go about it.I have it displaying the correct user and their current ClientCode but that's about it.
Private Sub TrackBar1_ValueChanged(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Trackbar.ValueChanged txtYears.Text = Trackbar.Value End Sub
This is the code for the trackbar. At the moment as the user moves the trackbar it inserts the value into the textbox. I want this to work in reverse also. user inputs value into text box, trackbar moves.
I know it is possible as my professors program does this.
However the items in the list that the listbox is bound to are not all String types. Some are DateTime and a few are Integers. I would like to have a datetimepicker displayed instead of a textbox for the DateTime types. How can I make this happen.To clarify some points the list is populated at runtime using reflection so I don't know which fields are what types ahead of time.
I am trying to create a accept User Name in textbox and as additional feature i want to show suggestion to user automatically. For example if user press "J" he names starting with "J" (present in name table ) should be displayed as drop-down.
Can i do it with TEXTBOX or is there any other simple way?
Private Sub EditPage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load'TODO: This line of code loads data into the 'InventorySysDataSet.tb_master_products' table. You can move, or remove it, as needed. Me.Tb_master_productsTableAdapter.Fill(Me.InventorySysDataSet.tb_master_products) sqlCnn = New SqlConnection("Data Source=ZEREYSQLEXPRESS2008;Initial Catalog=InventorySys;Integrated Security=SSPI")
[Code]...
what i want to do is to automatically change the selected option of the cboProductCode on page load depending on the result of a query executed onload also.
I am a former IT student and have not used VB in a little while but feel it can come in handy to help me complete some tasks at work.I am trying to write a small program which will open a url + a number for each number entered into the textbox. As an example lets say the website is "www.google.com/id=" and I enter into a textbox 3 values such as "134,325,2112", www.google.com/id=134, www.google.com/id=325 and www.google.com/id=2112 would all open at once.
The purpose of this is at work, we have an employee database and would like to load multiple employees at once (upto 6 at a time) to compare profiles. The issue with doing this manually is we have to fill out the search criteria for each, instead, I would like to load a link with parameters in it already filled out + the employee number we are searching for each number entered into a textbox on a VB form.
I trying to draw a bar chart based on the five values getting from the user via textbox...When i run this program no error is occured, but the chat is drawn...Can anyone please help me out in this regard.
Visual Basic 2010 Express: I have a form with a combobox that is populated with the names of locations from a datagrid which in turn was imported at run-time (Form_Load) from an Excel database. The Excel database (and the datagrid) also stores the information for addresses and phone numbers for their respective locations.
What I would like to do is have the phone number and address text boxes automatically be updated with the proper corresponding data when the user selects a location from the combobox. Whether the text boxes are updated from the datagrid or Excel database is not a concern; I'm mainly looking for whichever way is simpler.
i want to take a comma delimited text file and then select all unique records based on one of the fields in the text file. should i read the text file into a data table or just use a data reader?