If I typed in "Dim X as Integer" in a text box, I figured that I could just use If TextBox1.contains to make vb.net dim it. However, how would, if I typed "X = 3y * 9" in the text box, actually calculate that and print it in another text box?
I'm using a Microsoft Word form template to create objects in a form programatically, so depending on the information read by the program from the template.
So, I've got some fields where I store formula data for the form, in which I specify that the value for that field is obtained by multiplying other fields in the template. So I store in the string something like this:
"Text1.Text * Text2.Text"
So I need to convert these string values into variable calls to actually operate these values.
I am a beginner trying to write code. I am creating an application that is a questionaire with 3 forms that have questions for the user with text boxes, list boxes, and check boxes for response. Some of the text boxes with the user response are on different forms. Will that cause me problems? I would like to write code that will combine a literal string with responses from text boxes and string snippets which are inserted based on check box condition. I think I would like to create the string to be printed to a RichTextBox and then output to peripheral printer. How do I make inserting or not inserting a string based on check box condition? How can I trim the response string to allow a output string without annoying extra spaces and such?
Last year (2010) I came across a FANTASTIC command that allowed me to take a string of variables with a common delimiter and break it all back out into separate variables (possibly an array) with one statement.
[Code]...
As long as the delimiter was a unique specifiable character, this one-statement command could break it out into elements. my memory and point me in the right direction.
I seem to be running into an issue. This may seem like a noob question (which it really is, I only have experience in vb6 from years ago) but what Im trying to do is pass a variable from one form to another. Ive tried telling the first form to set the value of the variable on the second form like so frmsecond.variable = "value" but that does not work. Ive tried placing a public variable in a module to do it, but again, no luck. The only way seem to be able to get it to work is the second form setting the variable by reading the value from the first form like so [code]The problem I have with that code is what if for some reason the selected line gets changed as the form is loading or something to that nature. It doesnt seem very secure.
i am writing an application that will require users to provide login details. After the user has logd in a second form will be shown. Allowing the user to change his/her own details. What i have a problem is, im not able to pass the variables, containing username and password in the login form to the second form. Ive tried declaring the variables as Public but when the login form closes the variable are reset to zero.
I was thinking is there anyway VB2005 can be done if I create an animation( car) such that its movement can me opearted using another external component(example a sensor).
i need to call upon variables from different forms, in my first form i make a variable called "temp" i then use [code]to open the new form and hide the first, is there a way to access temp ( the variable declared in the first form) in the second form?
I have an interface that i have declared some of the basic internal functions, subs, properties, etc. This interface is then implemented into 3 pre-defined classes. These classes are end-use classes so they dont get derived or inherited elsewhere. I am trying to create a generic shared class that can operate on each of these 3 predefined classes and potentially more as long as they implement the interface.
I have a program that I need to operate functions based off of hotkeys.One of the most important things I need to be able to do, is hit Escape at any time and end the program.Remember, the program form will not be up, it will be a number of any other applications, I need like a global hotkey or something.
I would like to pass variables variables from one form to another but the thing is that there is no variable that is actually being passed. I have tried to use instanciation
Dim f2 as form2 f2=new form2() f3.textbox1.text="Whatever I want to pass", but this did not work
I am having trouble passing variables between forms. Ive tried many methods but none seem to work. The first method I tried was to dim a public variable on the first form and call it on the second....no success
Form 1: Public cliCode as string cliCode = me.tbClientcCode.text
Form 2: dim clientCode as string = form1.clicode or
Form 2: dim clientCode as string
On the Form2 load event.... clientCode = form1.clicode
With method 2 I created some classes on which form 1 loads and form2 access........ Public Class frmClient Private db As New ClientDataContext Public clientInstance As New BusinessLogic.classClient Public cliCode As String [Code] .....
Is it possible to share subscripted variables and their data between forms? So far I can't see the variables I made public in one form, in a second form.
i would like to say i am a novice programmer, in year 12. I am designing a small game for my HSC and one of my forms is getting very cluttered with controls and code. To resolve this cluttering, i have had the idea to create new forms for some aspects of the game (such as different game modes and so on). However, in order for that to happen i have to drag some variables of the new form to the old form, (these variables would be just booleans or integers to say whether you lost a game or won a game or something that would carry on to the main form.)
I know this should be easy but I'm either having a brain fart or I'm just more inept than I thought; probably a combination of the two.
Passing a value to a form on startup is a piece of cake, but I don't think I've ever had to do the following before in all my ooooh, 8 months of programming:
I have a main form with a button and a textbox. The button opens another form with a datagridview. What I want to do is pass the selected value from the DGV back to the textbox on the first form.[code]...
I have a Form1, the user types a "Client ID" in a textbox if it's not a valid one, it opens a Form2 in which the user selects the correct "Client ID", once selected he presses an OK button. And there comes the porblem.. it opens a new Form1 with the Client ID that he selected from Form2, but I still have the first Form1 opened. I have two Form1 opened...
I which to keep the original Form1, but with the value sent from Form2..
I'm using this code:
Code in Form1 Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Say I have public string variable called "_Test" on Form1, how can I allow Form2 to edit/read the variable from that form? I tried putting this on Form2:
Public _Test as String = Form1._Test
But if I start Form2 without Form1 being open, it gives me an exception.
i've almost completed my Yahtzee game except for the high scores function. I've got everything worked out except how to take the highscore variable from Form1, and share the data with Form 2
I am making a program where in form 1, the user inputs data, and the data is used in form 2.[code]There are 12 number boxes and 12 text boxes. I also tried to use a label (label 4) to test if i could even use the variables on form 1. I can't. When you press the button, It clears the text box, and removes the label.
I am saving scores form my game in to a dadt base but the game involves answering questions mid game that pop up in a seperate for so I have two scores a question score and a game score and at game over i want the two scores to add up and be displayed in one labe wich appers on the game form when my count down hits 0 so I tryed to add them
heres is the game code
Public Class frmplay Dim score As Integer Dim total_score As Integer
[Code].....
so I want to add correct answer to score and display it in a label thatwill show on my game form
I need to share variables across two forms in vb.net. One of them is the main form and the other is a child form.
Create a static/shared variable in one of the forms and access it in the other forms via: Form1 frm = new Form1(); //creating object of parent to access shared variable frm.a = "abc"; // passing value
Send an instance of the main form to the child form when creating the child form. The variables can then be accessed via a property function. Create global variables in a module. This seems like the easiest option, but I doubt it is the best option.I also read something about delegates and events, but I don't know how to implement this.
I am new to the forum and new to the visual studio set up and have been working at a practical at home and have ran into some difficulty. The notes say that I am to declare several module variables below the section entitledI have the rest of the form complete but have been unable to locate where I am to place this code
I'm having an issue where I need to pass the value in a variable from one sub to anotherHere is the scenario. I have two forms; Main_Form and frmClient. I take a value from frmClient and pass it into a sub called Form_Activate located in Main_Form. I then need to take the value from Form_Activate and use it in a sub called when the user selects a menu item in the toolstrip.Starting point is frmClient and the code there is this:
Private Sub Button1_Click(ByVal sender as System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Client As Integer