Still working on that overlay. I am stumped on what I think is my last function. I have a + and a - button that needs to control a text box that has numbers in it. For instance: TextBox1 shows the number 2 in it. When I click the + button I want it to increase that number by 1. It sounds too simple when I say this out loud, but I think I am stumped with this basic function. I don't know where to begin.
I'm trying to code an 'increase' button to prompt a user to input a rate by which to increase select prices in an array.It should request the increased rate, then request a number from one to five, representing which price in the array to increase.Then, if 'increase' button is selected again and another number from one to five is chosen, then that element should be increased.It's working, but all the numbers in the array are changed. And, when I hit the increase button again, the array is repopulated below the first price increases instead of only replacing the designated price.
'declare 5 element array of prices Dim prices() As Double = {12.2, 8.5, 12, 50, 2.4} Dim rateIncrease As Decimal Dim isConverted As Boolean
I have a webform currently works like a charm. It posts the info entered directly into my database with out issue.
I need to add a step in there where when the submit for is pressed an email will be sent to one of 2 different emails addresses.
The snippets below are the 2 statements I think I need to have in the code, I just haven't been able to figure out how to complete them.
'If (cmbIPTypeBiz.SelectedValue = "Static" And cmbNumIPBiz.SelectedValue = "CIDR/30") ****Then send to email1.com**** 'End If
[Code]....
The items in the starred out section are where I am struggling.
So, to sum up, I need to be able to make this form shoot off an email to one of two email addresses based on whether or not a specific field has CIDR/30 in it.
I am using buttons on my vb.net forms. I want a way in which if I drag my mouse onto a particular button it would increase its size and if I click onto it, it can respond to the codes. May be like I want it too look like those Macintosh laptop icons, whereby if u put my mouse on it, it increases its size.
Im trying to increase the size of an array by 1 each time a button is pushed and have the new value read into the array. I use a variable nIndexItems which is increase by 1 each time the button is pressed. I need preserve the existing data so I have done the following: ReDim Preserve arHours(nIndexItems) This increases the array but doesnt preserve the data. I found the following so I tried it but its not working wither: ReDim Preserve arHours(UBound(arHours) + 1) how to keep this data?
When new record is added, I want the vb to look at the last record in the database, look at its id, add 1 to it (+1) and generate a new number and display it in the IDTextBox.
I have a problem with snake game. I never tried to make a game with VB, but now i tried to make snake from this tutorial:So i added food to this snake game, and when i taking food, it increases score, but length cannot be increased and i don't know why. This code is in timer to check if snake head is on the food:
If p(m).X = food.Location.X And p(m).Y = food.Location.Y Then score += 25 food.Visible = False
This is the code I am trying to run. I am just trying to increase a number in the excel file by "1" each time the button is clicked.
Dim da As New OleDbDataAdapter("select * from [Vicky$]", cn) Dim ds As New DataSet da.Fill(ds)
[code]....
I get this error on the update "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information."
I have added a Split container onto my Form and within bottom Panel I have added a list box.How can I increase the size of the list box as I increase the size of the panel?
1: counting button clicks and saving them to a variable and adding two. For example, if a button was clicked 10 times, the value of the variable would be 12.I would start with:Dim Buttoncount As IntegerButtoncount = ....This is the part i dont know. I would think it would be something like button1.click.numberofclicks or something, but i cant find anything that works
I have already made my GUI with multiple forms using VB2010 and made buttons that would open and close them (me.hide and form#.show)My problem is how could I use a variable I've computed and displayed on a sub-total (cashier of sorts) to be used on the main form where it would display the bill on a listbox?Here's how the button works to compute for the item sub total
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim cstotal As Integer
What is the cleanest way to assign a value to multiple variables? For example, how can I assign FALSE to each of Label1.Visible, Label2.Visible, Label3.Visible, Label4.Visible, and Label5.Visible.Is there anything like
I have been using VB a fair bit in the past developing a Access Database, recently I wanted to give my front end interface a bit more power so I have started learning VS 2010.
Anyways, I am still using Access for my databases and i am having a bit of trouble working with the data in VS 2010, what i would like is the following:
A way to form a string or integer from a SQL query (from a single field or multiple on that row) assuming the query will always return one row.
Then a way to write string or integer variables back in to db fields.
example:
Dim cn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|ItemRegisterDB.mdb") Dim cmd As New OleDb.OleDbCommand With {.Connection = cn, .CommandText = "select * from tblItemregister where ItemID = 1"}
[Code]....
Example = ??? 'What would i need here to copy fields from that row to string?
I have declared a variable for all the controls of my form (Dim result As String) and when i close the form (me.close()) and open it again, the value of the result var don't go to nothing (""). Why is that happening? Close is actually the unload of the form. Shouldn't it delete all the information of the variables?
I have a MDI application and a very complicated class there which populates its properties from a dataset derived from an external database. Each form, including child forms have to be able to access that class and use its properties thorughout the whole session.I don't know where to 'preserve' these property values within the application. I kmow many books etc. suggest not to use public variables but I really can't find a way to solve this other than to use a public variable (which is a list(of my custom class) in this case. I have a separate class called PublicItems.vb and declared there my public variable as
Public Shared secuniverse As List(Of myCustomClass)Is there something wrong with the syntax because if I try to use the variable secuniverse in my main application class, I get the following exception:'sectoruniverse' is not declared. It may be inaccessible due to its protection level.
So I am currently attempting to wrap my head around create multi-threaded programs and I am currently running into an issue when using a Shared variable across multiple threads.The program is structured as follows: Public Shared IsActive as Boolean
Main Thread = GUISets the Value of IsActive through a Button ControlTwo Worker ThreadsBoth threads are while loops that read the IsActive Boolean Ex:While IsActive = True Do Work End WhileHowever when I change the value of IsActive from the Main Thread it causes the worker threads to stop (ThreadState = 16).
I have been reading that I have to synchronize/lock shared resources and have tried SyncLock and Monitor methods without success (it is entirely possible I am not using the above correctly, so If someone could provide proper examples for the above situation using the mentioned methods please share them).
I have created a structure with some variables that I'm trying to update during the course of a sub routine but they are not updating, when I cycle though them at the end all the variables are still set to 0.
Imports System.Data Imports System.Collections Structure Team
I am trying to populate some fields in Word document using DocVariable:[code]The proplem that I am facing is when I open the document after running the program the fields won't be updated, so I have to go each field and highlight it then > right click > update field to get the new value!I need a way to update them or my work will be meaningless.I forgot to say that the DocVariables are inside textboxes.
I am working with a multi form project. The long and short of it is that when i originally load form 1 ... all bool variables are false. Once i load form 2 and perform my operations some of my bool variables will be set to true.
I need to have some sort of object to listen for those changes. What i have come up with so far is the following. Private Sub patient_frm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[Code]...
The if statement will work but i need a way to make it keep looking for changes in the boolean variables.
how to share and edit variables between forms? I want the user to be able to enter a value into a textbox and the program store it and then load another form and do calculations and display answers but I can't get it to work.
Ok so my boss told me that I can't use DataSet's and dataadapter and such like this because it isnt good for scalability. So, I must change the way I have my 28,000 records binded to my form. The problem is, I'm only 3 months in with VB.NET and I don't know of any other way to accomplish what I need to do. I was reading somewhere that I can use a Class as my "Order" and I can bind the variables/properties to the form and with this, I can navigate through records while having controls on each important part of the "Order". Unfortunately, I don't know what I'm doing, this is as far as [code]Any guidance as to what I am to do from here in order to pull the data from my database and bind to the property, then to a text box/combo box, and a way that I can use my binding navigator to go through the many records.