Make One Variable = Two Others Instead Of Just One?
Jun 10, 2009
I posted this before and got a few answers that haven't worked for me so far. Therefore I'm going to post part of my code so you can see what I'm talking about. The highlighted part is what I pulled from another post and it's not working for me right now. I'm using visual studio 2008 and the program was written in Basic. I pulled most of this program from the net and started tweaking it to my needs, If you're familiar with arabic you will understand the letters, if not, just use A and B for the variables.
[Code]...
View 2 Replies
ADVERTISEMENT
Sep 5, 2010
Using Visual Basic 2008 Express. I need to pass a variable to another form. Or else make the variable visible to both forms.
View 4 Replies
Feb 17, 2011
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.
View 3 Replies
Dec 23, 2010
I have a variable and i need to seperate it into 2 variables so in code form its like this[code]...
View 1 Replies
Feb 11, 2012
I know that
Public Incognito As Boolean
is a variable called "Incognito" that is class-wide that is a boolean.My question is that is there a form-wide variable form that can like communicate with different forms. So if a variable in form1 is "True" than, how can you make a variable in form2 turns to "True" too?
View 1 Replies
Feb 9, 2009
I want to make a Variable textfield, so i can use it in a while loop. I know that in FLASH it's like[code]...
View 10 Replies
Jul 28, 2009
Private Sub NoteTabToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NoteTabToolStripMenuItem.Click
Dim NewTab As New TabPage
[code].....
View 6 Replies
Jun 10, 2010
Having trouble accessing a dim variable inside a btOk or Load event. when I dim a variable that will be used a lot, do I need to make it a class and then referer to it?
View 7 Replies
Oct 19, 2010
How do I name a variable depending on what is in the textbox?
Like would it look like:
Dim (textbox.text) as string
etc.
The reason I want to do this is because the user is gonna click a button to create a task. When the button is pushed, a label is created by the code I already have, the problem is, I want them to be able to click the button more then once and new labels will appear below the one that just was there. By being able to name a variable by what is in the textbox, I will be able to do so many things.
View 6 Replies
Dec 30, 2009
I have an issue with an app i am writing, i need to make a variable accessible to any module or class within the project but that cant be accessed outside of the app as it is accessing info the end user shouldn't have access to.
Ok, well a practice i have gotten into in the last few years is to declare a module on the same page as the main form and declare variables either friend or public (global variables). with my app public is not good so i tried Protected Friend but i cant use this within a module.
I tried placing it at the top of the main form but one of my classes can't access it, what would be the right way to do as expected. besides the main form i have 2 classes call them class1 and class2:- main interacts with both classes class1 accesses class2 class2 doesn't access class1
View 7 Replies
Oct 21, 2011
How do I make Variable eccessable to other forms in my app?
View 3 Replies
Oct 15, 2011
I need this code below to be able to make use of an Var called EditingIndecator, this Var is on Form1.[code]...
View 7 Replies
Dec 16, 2009
What I would like to do is be able to take a Dictionary of key value pairs and make the key the name of a variable and the value the value. From searching the net seems to be very vague on whether this is possible.
[Code]....
View 2 Replies
Nov 30, 2009
i have a drop down box, with 2 Options Yes and No,what i want to do is
if questBox = Yes
do this
else if questBox = No
do that
end if
but not sure how to do it.
View 1 Replies
Aug 7, 2009
Sometimes to make a variable/method/class name descriptive I need to make it longer. But I don't want to, I'd like to have short names that are easy to read. So I thought of a special addin to IDE like Visual Studio to be able to write short names for class, method, field but be able to attach long names. If you need to - you can make it all long or you can make single name long. If you want to reduce it - use reduction, like two views of the same code. I`d like to know what others thinking about it? Do you think it is usefull? Would anybody use the kind of addin?
View 12 Replies
Jun 14, 2011
I've tried to make a program whereby the input affects a variable.
If Label1.Text = "1" Then
store.number1 += 1
End If
[Code]....
I was just wondering if anyone knew of a better way of doing this, as I have to go up to 6 labels, each containing 100 numbers.
View 3 Replies
Mar 16, 2010
Is it possible to make a variable hold a reference to an integer instead of copying its value when using integerVariable = integerValue ?
View 2 Replies
Jun 9, 2011
how to make a variable public to all forms within the application.Eg
Public MyPath = "C:"
can do for one form but not all
View 3 Replies
Mar 9, 2009
How do i make a variable that can hold more than 1 piece of data. I wan't a variable that can keep 4 number in it. When i count them in using a for loop the only thing i have after it is finished is the last number counted in by the for loop.
View 2 Replies
Feb 10, 2011
How do I define a variable which holds double quotes. when I try to define the variable like this [code]...
View 2 Replies
Apr 3, 2011
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.
View 1 Replies
Apr 1, 2009
In visual basic , when you create a label in form view (via click and drag) is it possible to make the label have both a string and a variable included in it?
*
turns=1
label1.text = ("Turn:"(turns))
*
for example , so that label 1 will display
View 4 Replies
Nov 8, 2009
How would I be able to make a variable that holds the value of the directories that exist in the C:?
View 2 Replies
Feb 23, 2012
I have an array of comboboxes on a form. They are declared at the beginning. I wish to make these global variables so I can access them in another form. This does not appear to work.
Code something like this:
Public Class SecondScreen
Public OutputSelectControl() As Combobox = {O1, O2, O3, O4}
Where O1 O2 etc are the names of my comboboxes on this form. I wish to be able to address them from another form like so
localformvariablehere = OutputSelectControl(integervariablehere).Index
View 2 Replies
Mar 7, 2009
there is a way to turn the following code into a sub so I don't have the same boilerplate show form code in use a thousand times in a program:
Example:
Public InstanceOfFrmGeneric As frmGeneric
If InstanceOfFrmGeneric Is Nothing Then
InstanceOfFrmGeneric = New frmGeneric()
[code]....
View 4 Replies
Jun 29, 2010
I can make the compiler give me an error (Use of variable prior to assignment) with:
private sub Test()
Dim ord As Order
Dim ord2 As Order
[code].....
View 2 Replies
Mar 27, 2012
Today I investigated a logical bug in our software and figured out that this is related to the way VB.NET thread variables inside a loop.Let's say I have the following code:
Dim numbers As New List(Of Integer) From {1, 2, 3, 4, 5}
For Each number As Integer In numbers
Dim isEven As Boolean
[code]....
The problem is that isEven is declared but not assigned.In this specific case, it would be correct to write dim isEven as Boolean = false but I haven't done this.In VB.NET, a variable that is declared inside a for loop keeps its value for the next itaration. This is by design: [URL]but this is also dangerous pitfall for programmers.
However, until now, I haven't been aware of this problem/behaviour. Until now.Most of our code base is C# anyway, which doesn't allow the use of an uninitialized variable, so there is no problem. But we have some legacy code that is written in VB.NET that we have to support. So the best thing would be to generate a warning or even an error in this specific case.But even with Option Explicit / Option Strict this does not generate a warning / an error.Is there a way make this a compile time error or maybe a way to check this with FxCop?
View 2 Replies
Mar 25, 2010
I am getting the error:"Range variable 'sender' hides a variable in an enclosing block or a range variable previously defined in the query expression."for this
Imports System.Data.SqlClient
Imports System.Linq
Public Class Form1
[code]....
I can select any other item from the table without the error. "sender" has the same properties as "receiver" in the SQL table.
View 2 Replies
Aug 23, 2011
I receive the error -
[Code]...
View 10 Replies
May 10, 2009
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
[Code].....
View 7 Replies