VS 2010 - Calling Public Sub On Another Form

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


ADVERTISEMENT

IDE :: How To Calling Form Object Public Function From A Module

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

Calling A Public Sub ... Nothing Happens?

Jun 21, 2010

Im having trouble with this code, when i had it working with static variables set, it was fine, now i am using a passed variable, its not working... Might not be anything to do with it, anyhow...

[Code]...

View 5 Replies

VS 2010 : Determine Whether A Form Was Closed By Clicking The "X" Button Or By Calling Me.close?

Oct 15, 2010

Is there any way to determine whether a form was closed by clicking the "X" button or by calling Me.close? They both fire the FormClosing event, but I need to determine how the form is being closed so I can do different things.

View 7 Replies

Calling Showdialog() On A Form - From The Main Form's OnLoad Event Makes The Modal Dialog Go Away After A Few Seconds?

Aug 7, 2009

I'm having an interesting issue that I can't reproduce on a different project, but can consistently on this one. I have no clue what might be causing it, but am hoping that someone may have seen it before.

I have a main form, from which I run a series of checks. On this form, I have a listview control. Because of some issues with the refreshing of this listview control, I had to create my own messagebox. It's just a form that displays some text ( it also happens to look nicer than MsgBox; in my opinion, anyways ). It's been working great for months, until recently.

My problem is that on my main form's load event, I run this check, which returns an error within a try/catch block. I then call my custom messagebox with a message. It in turns calls it's ShowDialog() function.

In any other situation ( after the main form has been loaded ), I have no problems. The messagebox goes on the screen and behaves appropriately ( ie: waits for my input and acts as a modal dialog ( stops execution of my main form's thread ) ). However, on this onload event, my messagebox comes up and goes away almost immediately afterwards.

I've traced it all the way to the showdialog() call. For no explicable reason, it appears to skip right over this call, without me doing anything on the form.

Here's what the inner trace looks like ( when I put a breakpoint on the onclosing event for this messagebox form ):

CODE:

View 10 Replies

Can't Use A Public Sub In Another Form

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

Run PUBLIC SUB From Another Form?

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

Set Calling FORM Visible = False By CALLED FORM

Sep 6, 2010

Requested were made by Businese Analyst to set the few Main FORMs VISIBLE PROPERTY TO FALSE when the POPUP FORM is loaded.

[Code].....

When the MAIN FORM loads the POPUP FORM, on the FRMPOPUPCUSTOMER-FORMLOAD even, it has to set the MAIN FORM Visible to False.

When FRMPOPUPCUSTOMER FORM IS UNLOAD it has to set the MAIN FORM Visible = TRUE.

How to the coding is to ensure that different MAIN FORM when loaded FRMPOPUPCUSTOMER it will turn the MAIN FORM Visible to FALSE.

View 2 Replies

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

Asp.net - Access A Module Or A Public Class With Public Shared Members From Inline Vb Code <% .. %>?

Feb 10, 2011

I can access a module from code behind but not from the aspx page in inline VB code <% ... %>.

View 2 Replies

VS 2010 Public Class A(of A)?

Jul 22, 2010

Public MustInherit Class SingleInstanceForm(Of T As SingleInstanceForm)
Inherits Form
End Class

[code]...

View 6 Replies

Attempting To Make A Form Public

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

Cant Access Public Variables From Another Form?

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

Public Function With Form Scope?

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

Public Variable Not Delared In Other Form

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

Forms :: Calling A Function From A Form To Another Form?

Jul 22, 2009

how to call a function from a different form. Like the button click event. i have this scenario. I have a main form and a child form in the main form there is a navigation panel on the left side controlling the child form. What i want is if clicking the add record in my navigation panel will call a function in the child form to execute.

View 1 Replies

Declare A Public Param For Public Class Form1?

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

Declare A Public Variable And A Public Sub In An Aspx Webpage?

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

VS 2010 Public Variables For All Classes?

Mar 30, 2011

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.

View 7 Replies

VS 2010 Too Many Arguments To Public Function?

Jul 22, 2011

I am somewhat stuck on this little problem, I am using Visual Basic 2010

Error3Too many arguments to 'Public Function Calculations(txtSoilTemp As Double, txtSupplyTemp As Double, txtCarrierPipeWallThickness As Double, txtInsulationThickness As Double, txtJacketThickness As Double, txtExternaldiameterofcarrierpipe As Double,

[code].....

View 2 Replies

VS 2010 X509 How To Use Public Key To Encrypt

May 7, 2010

I am trying to do some x509 encryption and I am getting lost. I have generated my own self signed cert with OpenSSL, but am confused as to how to use my public key to encrypt.I found a few examples online, but in the first one, I do not see where you provide your cert or key for the encryption. url....The seccond is in C#, and although i can make sense of most of it, the line in particular tha tlooks important, but I can't translate to VB is this one: url....

View 1 Replies

Accessing Public Shared Function From Another Form

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

Create A Public Variable To Use On Any Form In The Application?

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

Get The Reference Of A Public Variable Using The String Name In Another Form?

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

How To Call Public Function Of Owner Form

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

Public Module Updating Form Object?

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

Unit Testing In 2010 Public Read Only?

Aug 10, 2010

Unit test method that has Public Read Only property, how do I set the public read only property?target.MyReadOnlyProperty = MyObject

View 1 Replies

VS 2010 'Infinite' Public Instances Of A Class?

Jan 24, 2012

I'm a little out of my comfort zone here having programmed in VB6 quite a few years ago things have changed a lot since then.My issue is I have a class that I've built which works with no issues but I would like to be able to keep a 'handle' of some description on this class so I can also make adjustments to it's parameters when the user changes something. My problem is that I need to do this for an unknown quantity of these class instances.

In the VB.Net language how would I create an instance of this class that could be accessed by any Sub within the application and each instance created can be individually accessed by specifying some sort of identifier?

View 2 Replies

VS 2010 Backgroundworker With Public Function And Listbox

Apr 18, 2012

I'm struggling with a thing or two...and i've read some stuff about the backgroundworker but im stuck Basically what i have is a : PUBLIC FUNCTION TEST (path as string) : which at the end of work , adds an item to the form1.listbox. That works quite nice but freezes the app. I've tried using the backgroundworker, the function in the background worker seems to work nicely, the bad thing is that i dont get any results in the form1.listbox.

View 14 Replies

VS 2010 Class Public Property Or Sub/Function?

Jul 13, 2011

I was wondering if someone could explain to me the differences between these 2 ways of accessing a class property.Access Way : 1 (To me this looks like im declaring the property of the class as a Global variable which can be changed anywhere

[Code]...

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved