I have been having trouble figuring out how to calculate a sum that the user inputs in to a textbox. On my form I have a textbox and a button. I would like the user to be able to input a sum like "3.5 + 2.87" and then click the button and the form calculates the answer for them. I need to be able to convert the string in to a sum somehow and then calculate it.
I am working on a 32-bit binary/hex/uint masking calculator and have run into a snag. When I attempted the following, it created an error:
For i as Integer = 4 to 126 TextBox(i).Visible = True TextBox(i).Clear()[code]....
Since this sequence of events is in 4 different places in my code depending on a user screen selection, for obvious reasons it looks really bad. Is it possible to use indexing instead?
I've been working on an auto talker, and so far, no errors. The only issue im having is to make textbox 3 to work with textbox 1 and textbox 2. I'm using Checkboxes, so You must check the ones you want. Like said, 1+3 and 2+3 doesn't work. It will only spam Textbox 1 OR textbox 2. Textbox 3 will not show up.
Heres my code :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If CheckBox1.Checked = True And CheckBox2.Checked = False Then Timer1.Start() ElseIf CheckBox1.Checked = False And CheckBox2.Checked = True Then
I am making a sort Server. But now the problem is that I am going to make a textbox that can make commands like 'ipconfig' in Cmd, but not that command. Its for starting server stopping server and such.
I tried: if Textbox1.Text = ".serverStart" Then 'Do Stuff here' End if But that didn't work?
I have a text box called TxtSearch on my form. The value entered should always be numeric before the search can be done if its any other data type the following Message box is give - Only a numeric value is allowed in this field", MsgBoxStyle.Information, "GCPM.. (Code shown below)
Private Sub TxtSearch_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtSearch.KeyPress If Char.IsDigit(e.KeyChar) = False And Char.IsControl(e.KeyChar) = False Then[code].....
Now, when you copy and paste a String value on the textbox - TxtSearch the KeyPress doesn't work. The TxtSearch doesn't prompt the message and when you click the Search Button the application crashes - dsiplaying an error converting data type varchar to numeric.. What I want to do is if someone uses the copy and paste tool to enter the value in the textbox- TXTSearch and there is a datatype not numeric the message prompt is called ..
I found that when group by multiple values does not work well with VB.NET, but it works well with C# ,here are my code, is there something wrong with my VB.NET Code? Here is my VB.NET code:
I have an application that requires data be entered, and after entering, a button is clicked to process that data. Clicking the button works just as it should--the data is processed properly. In constructing a test module, I provide a set of data values, followed by:
btnWhatever.PerformClick()
Nothing happens. I have used this syntax for years, and it has always worked flawlessly. I have triple checked everything else and isolated the problem to the failure of the PerformClick(). The PerformClick() is in a test subroutine that does nothing but fill textboxes and labels with default data, then calls the PerformClick() on the button to begin processing. Again, the button works fine, the data is entered as it should be, but the PerformClick() does not fire the click event.
I have a form that works on my local Machine I created into. I have Office 2007 on this machine. I created the Form with the Excel 12 Reference. I move the Entire conetence of the Project folder to my work computer. Which has Office 2003. Do I need to recreate the form with the Excel 11 reference. I could not get the form to work on work computer. IT has a com error. I am acessing the EXE for the debug folder w/in the Bin Folder.
I'm using vb2008 with DB MSA2007 (save it to MSA2003) on Seven(7)System After I create my project I build it(make exe). then I took the file of project (application) and the DB from Debug Folder.
I tried to run this application with DB on another computer it's system is seven and MSA2007 and work very well. then I run it on pc it's system XP and MSA2003. it showed this error
Application Error THE APPLICATION FAILED TO INTIALIZE PROPERLY (0XC000135). Click on OK to terminate the application
Is it possible to have a Textbox on a form that when the user inputs data, ( during Runtime )that data remains in the Textbox for good and the Textbox then becomes read only ? Is it also possible to make it so that the CD with the programme on, is in the PC when the programme is being used. Perhaps writing the Textbox data back onto the CD ?
I'm building a VB(2010) program to create the graphics for my laserprojector.The program works when I debug it in VB, but when I run the EXE program in the release directory, it doesn't work. The problem in the EXE program is theat I can't draw/view graphics in the picturebox..I coppied my whole program to a new VB project, but I'm having the same problem...In the original project, where the program works, there are no warnings or errors.
Tenho um Listbox com 70 linhas. Fa no Listbox um Drag do ltimo item para mov-lo para o primeiro item, entretanto quando o mouse atinge o alto do Listbox a lista n vai para cima automaticamente. Algu sabe como fazer isto? Obrigado!Lindolfo
I am building an app. that needs some input from the user, the user will have to move a (selected textbox) by clicking a button. The TextBox will have to move 20 points down or up from corent location by clicking a button.
I want to make a function in VB 2008 with which u can make a textbox change some letters within the textbox when u click a button. So example: Textbox1 has got in it: url...Then when I click button 1, it has to change ....
I have a TextBox in a Windows Forms application in VB 2008 (.NET 3.5) where a user can key an estimate amount. I am allowing them to key dollars and cents, and I want to round to the nearest dollar. The original code had the rounding down when the data was written back to a table, and that worked fine - I have this code in a "Save" routine that fires when the user moves to a different screen or record:
Dim est As Decimal : Decimal.TryParse(txtEstimateAmount.Text.Trim, est) Dim estimatedAmount As Integer = Math.Round(est)
I decided that it might be nice to actually do the rounding as soon as they leave the field instead, so they're not surprised when they reload the screen and find that 1822.60 is now 1823. So I took the exact same code and added it to the TextBox.Leave event handler. And the weirdest thing happened: instead of the variable est being populated with 1822.60 after the parse, it gets set to -1! What the...?
Debugging the handler shows that the value goes into the parser correctly, and if I do the parsing manually via the Immediate window, it parses correctly, but when I let the code do it, it invariably gets set to -1. What's even weirder is that any number gets parsed as -1, not just decimals, and any non-number gets parsed as 0 (which is correct).
Has anybody else ever run into this before? I tried moving the code to the TextBox.LostFocus event instead, but with the same results. I have no idea what in the heck is going on, and obviously there are workarounds galore for this, but it just makes no sense whatsoever.
EDIT: Here's the full event handler (current behavior for which is to put -1 in the TextBox):
Private Sub txtEstimateAmount_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtEstimateAmount.Leave ' Take any dollars-and-cents amount and round to the nearest dollar Dim est As Decimal
I have 4 checkboxes and 1 textbox in webform if i type in textbox 1,2 then checkbox1 & 2 will be checked !
directly after if i type 3,4 in textbox then the all 4 checkboxes will be checked But i want the checkbox will be checked accorcding to the data displayed in text box ..if textbox1.text =1,2 then only checkbox1 and checkbox2 will be checked and others are remain unchecked ...
and if i checked checkbox3 and checkbox4 then only 3 and 4 will be checked and others are unchecked...
how to do that in page load event I want to do this with 50000 checkboxes ..and more.... which displayed in my webform
[Code]...
But if i type 1,2 in textbox then checkbox 1 and 2 would be checked and agin i type 3,4 then checkbox1,2,3 and 4 all the checkbox will be checked ...but i want ...what everi type in text box only that checkboxes will be checked and others will remain unchecked.....
when clicking a button, the current date is inserted into a textbox and the focus is transfered to the textbox.
the problem is that Textbox15.focus() select the text inside the textbox. i wish to give that control the focus but place the cursor at the end of the text, with no selection.
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click TextBox15.Text = TextBox15.Text & DateTime.Now & " " TextBox15.Focus() End Sub
I have a database I am creating with about 50 users over a network. There are about 6 groups of users and these users are spread across 10 branches. I want to block/allow users from particular forms and views. For example I want branch users forms to be filtered by their branch number but depending on the group they are in they can only see some forms. i.e. 50 users, 10 branches, each branch has about 5 ppl of where 1 is in group A and 4 are in group B. I want all users that belong to branch 1 to see the information they enter, but Group B enter data but cannot approved or delete, and group A can enter, approve and delete. So then. On my login form I have the user type his/her username but the i want LEAVE function to update 2 textbox where I have named GroupName and BranchNo. Basically to run a query and look for the username and return in one textbox that user's groupname and the other textbox the user's branch no. This information will be used to filter forms and block the user from certain controls. This is the code I have so far but still can't figure how to display the results.
Private Sub UsernameTextBox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles UsernameTextBox.Leave 'Make Connection to database
[Code].....
It keeps highlighting the BranchNumber and UserGroup and giving error "Value of type 'String' cannot be converted to System.Data.OledbCommand
I have a form where a number of textboxes are programmatically created within a flowLayoutPanel and named by adding together 2 strings.
With the click of another button i hope to have all the values entered into these text boxes stored in a text file. However, i cant seem to find a way to add strings together to allow me to retrieve the values entered within the text boxes created.
Below is the code i have so far: BTW FLP is my flow layout panel and c is my calculated nmber of textboxes that are created.
Private Sub createTB(ByVal c As Integer) Dim x1 As Integer = 1 Dim y As Integer = 2
I have a checkListBox with items. I want a textbox to contain the items were checked. How can I go about removing it from a textbox if they user unchecks the item?
Private Sub frdList_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles frdList.ItemCheck Dim item As String = frdList.SelectedItem[code].....
I am trying to put text of my dynamic textbox in some other textbox when user changes the selectedindex of a list.But dont know why it is giving me error's.
Private Sub UserText_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UserText.TextChanged If Me.ListBox1.SelectedIndex >= 0 Then If TBnew.createdTB(Me.ListBox1.SelectedIndex) = 1 Then
I recently learned how to send the contents of a vb textbox to a flash textbox which is in an swf embedded on my vb form using a vb button to trigger...
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AxShockwaveFlash1.LoadMovie(0, "C:sample.swf") End Sub
[code]....
This workds great, however what i REALLY want to do is the other way around.... I want to click a flash button thats in the embedded swf and have it put text into my VB textbox... The text I want to dislay is:"well done!" SO Far:I have built a simple swf with a dynamic textbox and a button. textbox is named "sampleField" and its var is: "sampleFieldVar"...button instance named "Button1" is an instance of "button".
using as2 I have put the following code onto the button: (read this somwhere online) on(press){
I want a text in my textbox in gray that dissapears when the user clicks in the textbox.I am not sure if that is a good enough explanaition so here is an example:You often have search boxes on websites or application.In the searchbox there often is a text like "search", "keyword", "type here".As soon as you click with your mouse inside the textbox it dissapears.I could make this in code but I was wondering if there already is a textbox property for this?