Pass Form Name To Public Sub?
Jan 14, 2012
My plan is depending on the users screen resolution a different form will open. Thats all fine and works hunky dory.
However, the form pulls code from a public sub and updates fields on the form based from the public sub[code]...
My problem is how can I change the FORM1024x768 to say FORM1366x768 if the users screen resolution determines a different form is chosen. I need something like[code]...
View 7 Replies
ADVERTISEMENT
Nov 4, 2010
I have a public variable that I declared in form1 of an application. I am trying to call that variable in form2 and then pass that variable in a sql query.
If I declare
Public Class Form1
Public payPeriodStartDate, payPeriodEndDate As Date
How then to I declare that variable in form2 and how to I pass it to my sql query
SELECT [Exceptions].Employeenumber,[Exceptions].exceptiondate, [Exceptions].starttime, [exceptions].endtime, [Exceptions].code, datediff(minute, starttime, endtime) as duration INTO ScratchPad2[code].....
View 13 Replies
May 8, 2012
I have inherited some god awful vb.net code and having trouble trying to work out the generics for looping through the current structure in place.
here is a snippet of the struct
Public Structure ApplicationDetails
Dim ID As Integer
Dim AgentID As Integer
[Code]...
but i am not sure on the syntax to set the value and when trying to get the type i get item.GetTYpe() is not declared.
View 2 Replies
Oct 31, 2009
I would like an overview of System.EventArgs. I have an understanding of System.Object where I can pass data between subroutines and functions using Public Classes. I am curious what EventArgs do?
View 3 Replies
Aug 28, 2011
I can't use a public sub in another form...
Here is what I'm doing:
I created a button called BTest and a TextBox called TBTest.
When I press BTest, it writes on TBTest "BTest Worked!".
PS: The button BForm2 is just for Form's change.
Form 1
Public Class Form1
Private Sub BForm2_Click(ByVal sender As System.Object, ByVal e As
[Code]....
View 3 Replies
Jun 4, 2009
I have a couple of PUBLIC SUB's on my Form1. Is there a way that I can execute them on Form1 through another Form / Button-click? I am using a Dialog1.ShowDialog() for configuring some settings for my application. Now, I have most stuff on my Form1 set / loaded via PUBLIC SUB's (for example THEME SETTINGS, DROPDOWN LIST values and so on), and if I change something in the Dialog1 this Subs need to be executed again ...
Before my explanation gets too complicate, here a sample with a simple SUB:
Asume you have a Form1 with a Button1. On Button1Click a Dialog1.ShowDialog will be executed. In addition you have the following PUBLIC SUB on Form1:
Public Sub ShowMessage()
MessageBox.Show("Hello World!", "Message:", MessageBoxButtons.OK, MessageBoxIcon.Hand)
End Sub
How could I execute this Sub on Form1 from Dialog1 (maybe on a ButtonClick event)?
View 12 Replies
Feb 10, 2011
I can access a module from code behind but not from the aspx page in inline VB code <% ... %>.
View 2 Replies
Jul 12, 2011
I am attempting to make a form public. I've start out with this class:[code]I can see the stupid form thru intellisense, but when this code is run I'm getting a null reference exception. I believe this is because the stupid form has not been initialized. I thought that placing 'new' in my class definition would initialize the form.
View 4 Replies
Aug 25, 2010
I have a string on my main form called String1. When I open another form, I need access to this value. In the form I open, I have always done something like:Dim NewString as String = Main.String1
This has worked in the past. Well, I ended up renaming my forms (from Form1 to Main) in the property window and it now when I type the above code, it does not list Main as a form. Nothing that I renamed seems to exist now.
View 2 Replies
May 17, 2012
I have a Function for checking the input in a textbox and only allowing Numeric & Backspace; everything works fine so far. My form is for financials and it has about 20 textboxes; they all receive Numeric only data; there is NO alpha data on the entire form required. Note in the snippet below that I don't even need a decimal point as well.
Is there a way to handle ALL textboxes on this form without having to place the Function call in each textbox KeyPress event. took a long (5 year) hiatus from developing VB6
Public Function TrapKey(ByVal KCode As String) As Boolean
If (KCode >= 48 And KCode <= 57) Or KCode = 8 Then
TrapKey = False
[Code].....
View 5 Replies
Aug 9, 2010
I defined a variable in a form with
Then I want to check that variable in an other Form using[code]....
View 3 Replies
Aug 26, 2011
I'm having trouble on calling a public sub on another form. Here is the sub:
Public Sub BOTAO_NUMERICO(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles N0.Click, N1.Click, N2.Click, N3.Click, N4.Click, N5.Click, N6.Click, N7.Click, N8.Click, N9.Click
Dim Res_ant As String
Dim Res_atu As Double
If (Res <> 0) Then
[Code] .....
On form Normal, BOTAO_NUMERICO works fine, but on Cientifica it don't.
OBS: All objects on both forms are the same, with same name.
View 2 Replies
Jan 22, 2011
how to pass value from one form into another form...? for example if i have 1 mdiform and 2 form (form1, and form2) for load form1 i'm using system.reflection.assembly here is the code for load form1 :
Imports System.Reflection
Private Asm As Assembly
Private FrmNama As Form
Public Function GetForm(ByVal FormName As String) As Form
[code]....
after form1 load i call form2 from form1 and from form2 i want pass value, here is the code from form2 to pass value into form1 :
form1.textbox1.text = textform2.text
why value from form2 can't fill into textbox1 in form1?
View 15 Replies
Apr 7, 2011
Imports System
Imports System.Threading
Imports System.ComponentModel[code]....
how to declare "smsport" on class smscomms as public so that it can be access in class form1 or button1_click event.
View 5 Replies
Aug 26, 2010
How do declare a public variable .aspx web page that can be used in all the pages within my web application?
View 3 Replies
Nov 24, 2009
how to pass a value from an Independent form to a Child form...
here whis is the data from..
the indenpendent data is selected from the datagridview by just double clicking the cell the selected data will pass into the combox of child form (Note: this is combobox not textbox)...
i'm done with textbox it work fine..
look:
Independent form when user duble click the datagridview
Private BoxToUpdate As TextBox
Public Sub Start(ByRef DescItem As TextBox)
' Me.Close()
[Code]....
how could i able the value into combobox from independent form into child form...
View 1 Replies
Jun 10, 2011
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.
[Code]...
View 4 Replies
Mar 1, 2011
[Code]...
i have a function that i have in my data access class now i want to access it then declare and assign parameters and then insert data into database.
View 4 Replies
May 28, 2009
I have a query setup on the start form in my project - it looks for a user level (1 or 2 right now) I want to display/hide items on the form based on whether or not the user's permission (derived from this query) is a 1 or 2.
My question is, can i create a public variable out of this query to use on any form until the application is quit?
The query will be formatted something like this:
Dim
ssSQL As String = "SELECT UserLevel FROM [Employees] WHERE "
ssSQL &=
[Code].....
View 20 Replies
Feb 25, 2011
I have public variables in a module. I need to get the reference of the variable by using the String name of variable in another formell me how to do this?I need something like the following code:
Dim Var1 As string
Dim sVariableName As String = "Var1"
GetReference(sVariableName).SetValue = "testing"
[code].....
View 2 Replies
May 18, 2010
Just had a small doubt.Say i use something like this
vb Dim ownr as New Form1Dim Dlg as New Form2ownr.Showdlg.showdialog(ownr)
how should i call an public function of form1 in the form2 if form1 is owner of form2, and also if form1 is not the owner of form2 should i use FormName.FunctionName in both the cases.
View 3 Replies
Dec 1, 2009
I'm working on a project for my VB class at school. I am creating a form with several inputs and it calculates the total amount owed for a car sale. I have a text box for input of the TRADE IN VALUE of a car. the program is looking for a numeric input. If there is no trade in, how can i get this box to default to 0.00 so it doesnt error the program?
View 2 Replies
Jan 31, 2009
my problem is that i have an MDI Parent form. it has lots of child forms. on my MDI Form i have the toolbar buttons Add, Delete and Save.all or most of the child forms, i created a custom public procedure Sub AddNew, Sub Delete and Sub Save.what i'm trying to do is when i click the AddNew in the MDI Form, it will run the custom public Sub AddNew of the currently ActiveMDIForm. i have tried...
DirectCast(Me.ActiveMdiChild, Form2.AddNew()
but i'm getting an error "Unable to cast object of type 'Form1' to type 'Form2'" if the currently ActiveMDIChild is not Form2.
[code].....
View 5 Replies
Apr 5, 2010
I am using VB2008 In the Form1, i have coded
Public Function getText(ByRef ctlName As String) As String
getText = Mfg.get_TextMatrix(Mfg.Row,Mfg.Col
[Code]...
View 5 Replies
Dec 15, 2009
I am writing a control application for an inteface card. The complicated work of initialising communication with the card is written and working fine. However, my problem is to update the text in a dialog label on the communication interface form from a module that contains all the coding for accessing the inteface card. From the module, the interface dll returns data that describes some typical connection errors and the module then calls on Public Subs in the form to display error messages; for example:This is the Public Sub in the Module that initiates communication with the interface card:
Public Sub OpenDeviceInterface()
DeviceID = 1 - My.Resources.DeviceID
h = OpenDevice(DeviceID)
Select Case h
Case 0, 1, 2, 3
[code]....
What happens when these Public subs are called from the module is that the MSgBoxes I made to test the routine show up but the label text doesn't appear.I've tried; Refresh, on the label and the form without success...
View 4 Replies
Mar 4, 2010
shared variables of particular form in vb.net 2005
View 1 Replies
Nov 17, 2009
In vb.net, you can address a public variable from another form using the form name along with the variable.
form2.show
form2.k = 3
However, if you use a form variable to show an instance of the form, you must use that variable name to address the public variable. Two instances of the same form are displayed in the following example. The public variable k is assigned a value of 3 only in the first instance of the form, the one from form2.show. frm.k can be used to assign a value to the other form.
dim frm as new form2
form2.show
frm.show
form2.k = 3
Assuming only one instance of the form is shown in the application, is it reliable to address a public variable using the form name (form2.k), or is it better to show the form with a form variable and use that to refer to the instance of the form (frm.k)? Would the same answer apply to a property as well as a public variable?
View 2 Replies
Sep 20, 2011
i had no idea how to pass a value from one form to a database in another form...i was using the vb 2008...
View 2 Replies
Jun 3, 2009
how could i pass the value from Independent form to a child form..in my declaration from MDIParent form i declared child form as frmSMRP then in the frmSMRP i have declare one new form as form1
here is my code below.declaring child form under MDIParent form
[Code]...
View 30 Replies
Aug 26, 2009
Is it possible to pass a variable set in one form to another?
View 12 Replies