How To Add Public Var
Jan 12, 2009how to add public variable that can be accessed by all forms??
Module mdlStorage
public s as String
End Module
I made a module and tried to use it but it cannot be used?
how to add public variable that can be accessed by all forms??
Module mdlStorage
public s as String
End Module
I made a module and tried to use it but it cannot be used?
I can access a module from code behind but not from the aspx page in inline VB code <% ... %>.
View 2 RepliesImports 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.
How do declare a public variable .aspx web page that can be used in all the pages within my web application?
View 3 RepliesI want to know what implies to declare a function or a sub using public or directly Sub / Function i.e.:
Public Function Whatever()
' Process
End Function
versus.
Function Whatever()
' Process
End Function
explain me the difference between them? I'm new to visual basic, and I need to know the very basic things in Visual Basic allowing me to become a professional User
View 8 RepliesIm 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]...
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]....
I am looking to crack(Break) public key of DLL component
View 5 RepliesI have been playing around with VB for a while now, but still need to consolidate some thoughts. I was wondering if anyone could answer this..... Whats the difference between say Form1_Load and Public Sub New() on form startup? The reason i ask is i normally add calling subs to the form load process, but can you add any startup calls to the Public Sub New(), and if so, what is the advantage?
View 1 RepliesHow can I use my VB.NET application to get the public IP address of my computer?
View 2 RepliesPublic Sub SToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SToolStripMenuItem1.Click
Lots of code
[code].....
Public Sub mainlogin_Authenticate(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.AuthenticateEventArgs) Handles mainlogin.Authenticate
'Are the credentials valid?
If Membership.ValidateUser(mainlogin.UserName, mainlogin.Password) Then
'Has the password expired?
[Code]...
Error 6 'System.Web.SecurityUtils' is not accessible in this context because it is 'Friend'.
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)?
I am working on someone elses code, and this is in a Public Class I have the following code (same error msg both procedures):
Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
MyBase.New(info, context) <<<------ Line With Error
End Sub
[code]....
and get the error message "Too many arguments to 'Public Sub New()'"This is the first time I have seen this type of code in a class?
[code]
Public Class Printing_CopyFrm
Private quer As String="select * form cust_details"
Public Sub New(ByVal query As String)
[CODE]...
I'm converting a VB.net library to C# and having trouble finding the C# equivalent to a VB.Net Public Module.
In the same VB class is a With block. Any idea what the equivalent might be for that as well.
I have a public function to call default email client.Public Function OpenEmail(ByVal EmailAddress As String, Optional ByVal Subject As String = "", Optional ByVal Body As String = "") As Boolean
[Code]...
I'm getting an error in .net when trying to declare a Public class on my code behind page.
Partial Class _Default Inherits System.Web.UI.Page
Public someVariable as integer
Public someClass as className
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load [...]
The error I'm getting is BC30508: 'someClass' cannot expose type 'className' in namespace '<Default>' through class '_Default'.The goal here is accessing the class properties in script blocks on the aspx page like this <%=someClass.classProperty%>
I'm not sure if I'm trying the right methods (I've tried several ways of declaring the public class) or if it can even be done..
I'm attempting to call an external public sub from another dll. I've added the dll as a reference and in VS Express 2010 it shows in my intellisense, however, it errors "Non-shared member requires object reference.[code]...
View 1 RepliesSo, I make a public array: Public files As ArrayList
I try to add a value to the array inside of the "Form1_Load": files.add("Hello")
Which returns a null error. how to add values to a public array for multiple subs to access?
At the moment i'm working hard to better understand aspnet (VB), still learning and still enjoying, but at the moment i'm struggling with (i think something realy easy) but can't find out how to fix it,what i need to do is: assign the propperty Weekday() of CSlot Dim CSlot As New timeslotParamTO I have to assign te propperty weekday to Cslot but the propperty must be 1 or more items from the Public Enum WeekdayEnum. i just can't figure out how to assign 1 or more weekday's to CSlot.weekday().
[code]...
I am doing an activation server which will enable users to activate their software. The problem is that they own the public key.. the verification method needs the public key to check signature of the license file. My concern is that someone could generate their own license file using two key (public and private) and then change the public key on the client which would spoof his current license.
Is there any way of avoiding this ? Where should the public key be stored ? You have to take into consideration that the checkup is done on client and the signature is created on server.
We have a common component in our source which contains all the enums (approx 300!) for a very large application.Is there any way, using either C# or VB.NET, to iterate through all of them in order to perform an action on each one?
How to iterate all "public string" properties in a .net class is almost relevant but the enums I am dealing with are a mix of types.
I don't know much about the CIL, except that there is metadata in assemblies that record the type information.Would it be possible to create some reflecting tool that is able to read a C# or VB.NET assembly and change its metadata so that all class members become public?
View 4 Repliesi am trying to call a public sub within a class that resides within my form1 code:
[Code]...
Is their a reason why I cant declare a Public Const this way?
HTML
Public Const whatever as string = my.application.settings.xxx.tostring
I don't understand why not.
I am making a program where there is a number of strings are needs and they need to be pre-defined. I rather not store it all in a XML file as I don't want anyone going in and altering them.
Has anyone ever created a class of public constants just to make cleaner code or is it considered bad practice?
I would like to assignload a file to "Public jChart As Image" and use it through the module.
View 1 Replieshow to connect VB2010 to MS Access and how to declare the connection as public? I just switched from VB2010 from VB6.0 and found some major changes since VB6.0 in terms of interface and functionality. Must I use a global module for it just like in VB6.0 (.bas module)?
View 1 Replies