I have one form, which the user enters upto 5 websites then clicks go - I have on the second form, the one with the webbrowser. A timer which checks if the web browser is busy then either a green light or black image will be shown along side the assocaited input box on the first form.I am finding it impossible to feed variables into the clock through ByVal, like I would a subroutine or function.
Private Sub ActiveMe_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ActiveMe.Tick If ((WebBrowser1.IsBusy)) Then Hey.BackColor = Color.Black[code]....
'Error message says Hey is not declared, as i can't pass it through to timer
The variable Hey is determined by the first form - Which picturebox.I have an if statement which simply says if inputbox one has url enter then Hey = Picturebox1, If input box2 has url entered then Hey= Picturebox2 etc.What I want is the timer to check the page has completed loading or is still loading or refresing and the appropriate green or black to be shown aside url input box on first form.I considered using a sub or procedure to act as a clock (a large for loop with another for loop within it, acting as a delay). But found this slowed down theapp to the point of crashing it.
I want to pass variables from one form to an other. The variables i I need in the second form( called" Hulsview") are :" hulsbreedte" and" hulslengte". To check if the varibles are passed I added a textbox in the second form,called" hulsview" to check the variable" hulsbreedte". The value selected in the combobox on on form1" hulsbreedte = HulsBreedte1.SelectedValue" returns always 0 in the textbox on de second form.
Here is the code form1: Imports System.Drawing.Drawing2D Public Class Form1 Inherits System.Windows.Forms.Form Public hlb As Point 'not used [Code] ..... I am using vb express 2010.
I have a VBA form in Microstation I am using to try and help automate a task. The only problem I am having is I am reading a textbox (Filebox.Text) and setting it as the variable (FN). It works, because I used Msg.Box (FN) to test it. However, in two of the lines of code, I am trying to use (FN) to pass the typed in filename to the command to run in Microstation. Unfortunently, it gets passed on as (FN).dgn instead of the actual filenale typed into the textbox. Is there a way I can make the variable actually seen as a variable? Code on Pastebin: url....Also, not sure if this is the right section, 100% new to VBA, coming from a world Bashed together.
i have a dialogbox (dialog1) i will assign the input from textbox a variable to the from1 but i cant do that.the variable in form1 is Dim get_from_dbox As Long i try to assign to it from dialog1 like below it fails form1.get_from_dbox = Textbox1.Text but i can assign to textbox??like that which works well
form1.RichTextBox1.Text=Textbox1.Text I am new programing i know i am wrong .don't know where?
What's the simplest way to pass a variable back and forth between 2 forms?Let's say I have form1 and form2. Form2 has textbox2 and button2. When button2 is pressed I need the text in textbox2 to display in textbox1 on form1.
So I'm pretty new to operating in the VB.NET environment, so this might be really basic. But my issue is this. I am writing an application to get the next available computer name within active directory. I have an VB program that queries active directory and finds the next available name. I also have a VB form that will allow you to set the name of the computer and which Active Directory OU it should go into. I would like to have the program that finds the next available name run right away when the app is opened, and then pre-populate the computer name field in the VB form with the next available name from Active Directory. However I'm having a very difficult time finding how to do this. I've tried adding the first program in the ApplicationEvents startup area, but I'm not sure that it's running, and I can't find how to programatically pass the result from the first program into a textbox field.
My problem is that is have 4 forms, 3 of these forms allow me to pass variables between them.. however one form the Booking form won't allow me to pass the txtTotal variable to the Confirmation Form.
All the other forms all me to do this, im not doing anything different i can see... im thinking that perhaps another part of the form is prohibiting me from passing that txtTotal to the Confirmatin form.[code]...
All the other forms all me to do this, im not doing anything different i can see... im thinking that perhaps another part of the form is prohibiting me from passing that txtTotal to the Confirmatin form.The following is for the Confirmation form, it should display the txtTotal in lblprice from the Booking form but shows nothing
Public Class Confirmation Private Sub btnBack_Click(sender As System.Object, e As System.EventArgs) Handles btnBack.Click
I have one form, which the user enters upto 5 websites then clicks go - I have on the second form, the one with the webbrowser. timer which checks if the web browser is busy then either a green light or black image will be shown along side the assocaited input box on the first form. I am finding it impossible to feed variables into the clock through ByVal, like I would a subroutine or function.
I have several text boxes named txtWidth1, txtWidth2, .....thru txtWidth12
I am trying to make some of the text boxes visible depending on the value of a variable "y". I thought I could do something like below, but I know line 9 is definately wrong. Private Sub txtQty_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtQty.TextChanged Dim x As Integer
I have a problem with my program. I wanted to know how i can make a global variable like an integer be recognised in any form so in essence linking to two forms together. Also how do I store an integer that has been typed by the user into the textbox? This integer will then be stored in the global variable. I have got two forms, one is for the user to interact with and the other is going to be used for displaying the global variable.
I have an application consisting of 2 forms (Form1 and Form2).There is a text box on each form and they are both named Text1.From a sub routine in a module, I want to alter a text box on one of the forms. The sub determines which form to write to and attempts to refer to the form using a variable.But in the example below, gForm never gets declared when it's nested within the If statement.[code]The actual application is not so simple and I need to use this or a similar approach throughout the application in order to reduce code redundancy.To recap, I want to alter a control on a form by replacing the form name with a variable name. [code]
i need to call mdi form toolstripmenuitem name using the string variable. for ex, mdi form is Form1. toolstripmenuitem is customer master if i do like that "Form1.customer master.Enabled=True" its working
but my issue is i stored customer master in a string variable like mystring="customer master" i need to enabled using the string variable like Form1.mystring.enabled=True
I'm having an odd problem when making a form visible and not visible and it not continuing to function. Here is what I have happening. I have a main form (frmMain) that is an MDIParent. On this form I have a menu to open a second form (frmCalculate) and populate a listview from Items in the database.
As I click or select items in the listview on frmCalculate the tag is read and data is pulled based on the id stored in that tag and fills in various fields on the form. This works great. However, I also have a context menu attached to the listview that allows me to perform a "what if" scenerio on the items I am calculating. When I select this menu, I hide the frmCalculate and open the frmWhatIf form where I can mess around with values on the item I had hilighted in the listview on frmCalculate. Nothing is pulled from or written back to the database here, all the information is filled in from fields on frmCalculate. It just allows me to look at rising costs and how they will affect my margins.... anyway.
If I then close frmWhatIf, it brings my frmCalculate back by setting its visible propery to true (never closed frmCalculate, just hid it). At this point if I click an item in the listview I get an exception for a null reference. IF however I never hide frmCalculate, I can open and close frmWhatIF without ever having an issue. Why do I lose the functionality to select items just by hiding and unhiding the form? As a test I added two menus to the toolbar on frmMain one called hide and one called show. I then opened frmCalculate with original menu item to populate the listview and selected a few items to test that it was working and then using the hide menu I made the form invisible and the show button to bring it back. This yielded the same exception so without even opening frmWhatIf the problem still occurs.
I want to alter the .visible property of a label based on if a variable is positive or negative (Hiding it for negative values) But I want to do this for lots of labels so If Statements are too bulky.
I tried this:
Label1.visible = CBool(IntVariable1)
But it turns out CBool returns True for ANY value and False for Zero.I'd assumed it would be True for positive values and False for negatives.How can I do it without if statements?I considered Modulo or SquareRoots to somehow convert a negative number into zero, but didn't want to complicate things with imaginary numbers.
ok to start i know very little about VB6 but i am very good in true basic lol (stupid school teaching the wrong language -_-) anyway im just asking you to make the answer as clear as possible because i don't know very much. heres the problem . ok in the above example i have a button that (for my example) can be used to build a house (lol) i then have a variable in the button sub called money which will have 150 subtracted from it when the button is clicked my problem is it say variable not defined when using this button ... i have declared the variable in a module and in form load along with my other 50 or so variables. my question is how do i pass the variable into this sub and then send the new value back into form load so it can be sent into another sub for more calculations.
I am currently trying to teach myself how to program VB.Net in Visual Basic 2010 Express.I've been working on a little project for a while and have hit a wall. Normally I can find what I need online but I am now at a complete loss. Essentially I am trying to pass a pair of variables from Visual Basic (file names actually) to VBA so that I can copy/paste data from them using VBA. What I need is to find out how I can pass variables (in string form) back and forth between VB and VBA
later under that Sub I have the program go to anothrer SubRoutine that uses the same Elev variable. Within that subroutine I get a Variable not declared error. My book talks about using "Static" but in the context i guess I am using it, it hasn't worked.
What is the best method of tranfering the information from one sub to another.
I am using VS 2008.I have an application that has a variable defined as an Application Setting. I use this variable to define the connection string so I can change the location of the database withour having to recompile the application.My application references a class library. The Class Library is the one that manages the database. The DLL is referenced by my application.How can I make the class library use the Connection String defined as an Application Setting of the consuming application? If I say in the class library:sdRadhaAllied.Schema.Connections(0).ConnectionString[code]...
VS 2008, .NET 2, Win XP I need help with passing a String variable from App to DLL?Why: I have App that on UnhandledException needs to call ErrorReport dll, send to that dll some strings like: App name, stack, error... Dll will send through internet this gathered data to me.
I can open Dll, close it, code it, but I can not figure it how to send data to it like VB App name, VB App version, VB App error.message For example I can in my form make a global variable like Public TestGlobal As String and that I can call from anywhere in my app, but how to do it with dll?