Variable As Part Of A Control Name?
Mar 31, 2010
Is it possible to use a variable as part of a control name kinda like you would use a variable in a SQL statement. For example:
Lets say we have 4 text boxes txtP1Val, txtP2Val, txtP3Val and txtP4Val. Is it possible to have the P1 - 4 as a variable so it would be "txt + Some string variable + Val"
View 4 Replies
ADVERTISEMENT
Jul 25, 2009
Basically, I have a large number of text boxes. Within these text boxes, I'll be doing calculations based on user input and other things. These boxes will be grouped by numbers, eg Cost1, Profit1, Stock1... Cost26, Profit26, Stock26. Without too much explanation, I went to write a FOR loop to perform a repetitive calculation across multiple groups, and the following line came up.
FOR num = 1 TO 26
Cost(num).text = ItemCost
What I've tried to do is use a variable to decide which 'Cost' textbox, from the available 26, to use in the calculation. For whatever reason, it won't work. I would like to be able to use a variable to specify exactly which textboxes I want used, so that on the 3rd pass of the loop, the 3rd box is used, and on the 19th pass, the 19th box is used. Otherwise, I'd just have to do each calculation separately, and write the same thing 26 times, with slightly different numbers.
View 2 Replies
Mar 15, 2009
how can i add a certain part of a textbox to a variabele
eg.
[Code]...
I am making a web browser whit a google search. The intention is that the search term (single words) is split and that each word is added to another variable
View 7 Replies
Jan 11, 2010
I'm working on a small accounting app. I have a query to show transactions with a running balance.
SELECT transactionid, transactiondatetime,
amount,
(SELECT SUM(amount)
FROM dbo.transactions as D1
WHERE D1.transactiondatetime <= D0.transactiondatetime) AS balance
FROM dbo.transactions AS D0
I capture a gamesheet for a certain week. so if I select a date on a monthcalendar the sheet applies to the weeknumber of the selected date. When I save transactions I take the date at the last day of that week as the transactiondate. I need to store a datetime though because my query works of the datetime to get an accurate running balance. How can I append now() time part to my date variable and then store that in a datetime variable to get a transactiondatetime.
Here is my code for getting a transactiondate:
Dim dt As New Date
dt = Me.MonthCalendar1.SelectionStart
'get last date of week. Friday
Dim tdate As Date = dt.AddDays(5 - CInt(dt.DayOfWeek))
View 2 Replies
Feb 20, 2011
I have split container in which I am dragging controls (picture boxes). I would like that part of the dragged control (picture box) that is outside the split container to be invisible. Currently it is on top, and the entire control is visible. Please help me know how can that be accomplished?
View 9 Replies
Nov 24, 2010
How do I paint the part pointed to?
View 1 Replies
Mar 11, 2010
I have added a ribbon control to my application but i have a problem. i have added a simple button to that ribbon or Orb
When i click on the RibbonOrbOption at run time i just see this.But i do not see the item1 button displayed.
This is the properties menu image
View 3 Replies
May 31, 2009
I want to find the values from a number of dropdown and textbox controls inside a repeater control.
db.ConnectionString = SystemConnString
db.Open()
Dim selectedAdTitle As String = ""[code].....
AdTitle and AdFullName dont seem to be bringing across the values. There is no error so they have found the control ok. Below is the ASPX file code.
<asp:Repeater ID="myRepeater" runat="server">
<ItemTemplate>
<asp:DropDownList ID="AdTitle" runat="server">[code]......
View 2 Replies
Aug 27, 2010
How can I make my webbrowser control to show only a specific part of the site. for example show only the google text on [url]...
View 1 Replies
Mar 2, 2012
ive search on the net on tab control in vb winforms but no luck. It is possible to change the color of the "rectangle part" at the topmost of the ab pages in tab control ? I have 5 tab pages and i want the tab pages small rectangle at the upper part.[code]Is this possible guys using only the properties on the tab pages? I dont need a very long codes which i don't understand in the first place.
View 1 Replies
Mar 10, 2008
In my project, I have a form with a background pic that I like, but unfortunately, I also have a ListView on that form which covers most of the picture. Now, is there a way to find the part of the background image concealed by the ListView, and then display it as a background image of the ListView at decreased opacity? You know, like a vague image.Just one more thing, setting the form's transparency key to the background color of the ListView is not an option.
View 39 Replies
Feb 22, 2011
im making an application in vb.net (duh!) anyway i have created and coded the whole project and it performs exactly as i want it to (i dont need code help). my problem lies with the fact that my project is 2-3 parts
1.a setup form that gathers inital data about the enviroment stores this data encrypted in a config file. after inital setup this form is not displayed again. but needs to be run on both computers
2. the second form is the real application form im in the process of turning this part in to a background service anyway this form is the one that establishes the connection between two nodes it works correctly
3. the config files
anyway here is my problem i want to make this application distributional with just one file the (.exe) and have this .exe make everything else happen. it runs the setup form and creates the first config file which it does then it needs to produce a copy of just the second form and the config file to transfer to workstation #2 that will run independtly without the whole application which i cant make happen then it needs to turn both workstations application on by only starting one on either computer and invoke the other computer to start its corrosponding app also no idea how to make this happen any ideas or suggestions as to where to look to try to find my answers.im thinking i might need to make two seperate applications (a setup app, and the running app) and include them both in a project and use the setup.exe to to package them together this is a little side project that im making for my self to use to make programming a little easier so i plan on giving it out to some fellow students to test and tell me what they think so im not really worried about ease of use or complicated procedures yet but if it turns out to work and actually be of use to anyone else i would be willing to rewrite it to distribute to the masses but for now i just want it to work for me.
View 4 Replies
Jan 12, 2012
my requirement is that i have to count occurrence of a certain date and between two months
suppose i have 10-jan-2012 now i have a date range 1-jan-2012 between 1-feb-2013 my requirement is that if i find 10-jan between 1-jan-2012 between 1-feb-2013 irrespective of year i know that 10-jan will come twice between 1-jan-2012 between 1-feb-2013 i am not understanding how to do this.i meanto say that i have to compare only day and month part of the date which will solve my problem
View 1 Replies
May 21, 2009
in my text file i have two part. Called bottom and top. So i need to read the Top part first then and match the line with bottom part. Its like this
[Code]...
View 5 Replies
Nov 24, 2009
I'm trying to add a varible to a control, so I can reference the Variable with the Controls name. I would like to set the variable how you would set a regular Integer. [code]...
View 3 Replies
Jan 19, 2011
I have the following code inside my MDI parent form:For Each crl As Control In me.Controlscrl.?????Next
The code mainly used for getting some info from all child forms.I can get all the general property like size, location by crl.size or crl.location. But if all the forms have an own variable like myTxt. How could I get this own variable by this For Each method?
View 2 Replies
Feb 4, 2010
I have a simple control that sets a variable to a value. What I want to be able to do is check the value of this variable on another form.Here's the code:
[Code]...
View 4 Replies
Jul 15, 2009
What type can i assign a for loop control variable? I want the for loop to be the output file of a calculation, but i can not define it as anything, and i do not know how to write it so that the output is actually what the code spits out once the code has finished running.
[Code]...
View 3 Replies
May 8, 2011
trying to set the result of dropdownlist to a variable but having great troubles.
Sub OutageSource(ByVal sender As Object, ByVal e As EventArgs) Handles Year.SelectedIndexChanged
Dim year As Integer
[code].....
View 2 Replies
Mar 27, 2012
I'm working on a function that handles events from a number of buttons and trying to define a Select...Case based on the clicked button. Something like this...
Private Sub btnClick(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles btnThis.Click, _
btnThat.Click, _
[Code]....
which don't work either. Is there any way I can define a Select...Case in this manner or is it always destined to fail due to the attempt at comparison of reference types?
View 3 Replies
May 31, 2009
i have few cotrols on form (text box, combo box, checkbox etc). Thru some condition i stored the name of the control in a variable.
for example
dim cntrlname as string
if x=1 then
cntrlname = 'txtCode'
[code]....
at some other place on form i want to use above variable to give the focus to control.
View 9 Replies
Mar 24, 2009
The basic question is can I assign a variable to represent a control? As an example which of 12 tickBoxes have been ticked. Is this possible with a for next loop?
View 5 Replies
May 7, 2012
I have many textboxes that I need to reference dymanically. The controls themselves aren't dynamic, just the way I need to reference them.I've got several text boxes say:
txtMe1
txtMe2
txtMe3
...
txtMe100
I will need to randomly change one of the properties of the edit boxes. So lets say it picks a random number between 1-100 which is 56. So, I would want to change the background of my 56th edit box to:
txtMe56.Backcolour = Color.Gray
The only way I could think of doing this would be to have one giant select case statement to evaluate the random number. But, that is really dirty and not the best peformance wise (this could potentially get called hundreds of times) so was wondering what my options are?I tried to concatenate the random number to my generic control name 'txtMe' but it throws a wobbler. I essentially would want the following to worK:
dim iNum as integer = 56
txtMe & iNum & .Backcolour = Color.Gray
View 2 Replies
Sep 18, 2010
How do I take data from a control and turn it into a variable? I'm trying to use a textbox and turn the data into a variable so I can do addition.
View 8 Replies
Jan 9, 2010
If I have a TextBox control with the Name Property = Textbox1, is there a way to use a variable for part of the name - like this:
Dim i as String = "1"
"TextBox" & i & ".Text" = "Hello"
View 3 Replies
Sep 5, 2011
I have to pass a global variable to a control textbox. but after running the code the textbox is empty[code]...
View 10 Replies
Nov 22, 2010
How could I create declaration(event) to a variable control in VB .net ? [code]please i need to know how to insert this (declaration) newweb_ DocumentCompleted it's similar to WebBrowser_DocumentCompleted but it's a variable
View 5 Replies
Oct 9, 2010
I have a number of tabpages that each contain a datagridview control only. Based on the results of a SQL statement I then loop through each tabpage and set its name. The reason for this is that at runtime (and depending on the results of the SQL statement), the contents of each tab page will change - henceI loop through the tabpages and set the name/ text (to reflect what will later be shown in the DataGridView)
The datagridview control on each tab has the default name e.g. DataGridView1, DataGridView2, DataGridView3 so it's easy for me to loop through them e.g.:
for i as integer = 1 to 3
[code].....
View 4 Replies
Mar 14, 2009
In vb.net 2005 how would one referance a control as variable and change it"s properties. Such as in control X visible = True. Tryed string manipulations that did't work.
View 1 Replies
Jun 21, 2009
how can i cast a control to a type variable? heres the code i'm trying to use:
vb
Public Class form2Ex
Inherits Form2
Private list As Control = MyBase.CheckedListBox1
Private listType As Type
[Code]...
View 6 Replies