Referring To Self In A Class Function?
Apr 1, 2010
I want to create a function inside my class that will return a boolean on the existence of some data within any structures created with the class.
Public Class MyObject
Public Object1 as String
Public Object2 as String
[code]....
What I don't know how to do is refer to the object that called the function to get values, including the number of items in the referring objects array.
View 2 Replies
ADVERTISEMENT
Jul 20, 2009
I have added some classes to my project and now i want to define a variable as one of the classes, for example the class is called xml and i want to create a variable called XMLfile and have it as the class XML.
Can this be done? Or can variables only be declared as types (like Integer, string, etc)?If you're not living on the edge, you're taking up too much room
View 4 Replies
Feb 21, 2009
Whats the function for converting a string that contains a class, into a class?for example
Public Class Desk
Public GetVar=1
End Class
Dim T = "Desk"
Dim Furniture = New T
What do I have to do to T to make it into a class from a string?
View 3 Replies
Dec 9, 2011
The redirect .NET uses to send users to my custom 404 page, wipes out the referringURL.[code]...
View 1 Replies
Apr 3, 2009
See this example:
''//file1.vb
Sub Something()
''//...
Functions.LogInfo("some text")
''//...
End Sub
[Code]...
View 4 Replies
Feb 21, 2010
I am trying to do is get interoperability between my "mainwindow" and a class. As far as I know the way to do this is to create an instance of the class (in "mainwindow") for example and then use that instance to call the functions etc... This works. However I want to allow the class to call functions in the "mainwindow" The moment I declare the instance on the class as well it goes into an endless loop.
View 4 Replies
Jul 14, 2010
I need a string of code that refers to it's filename on the computer. Basically like how batch has %0% to refer to the batch file's name.
View 4 Replies
Feb 24, 2009
I�m using a loop to open up a number of forms in my app. The forms are named after dates from a db. They are "created" at runtime so to speak.
Everytime a form is opened, the name adds to a dropdown list in an mdi parent form. The first item in that dropdown is a "close all". I want that item to do just that - close all the forms corresponding to the names in the dropdown list. I�m thinking of looping with an integer, starting on 1 (since the "close all" is 0).
So I need something like:
forms(mdiparent.toolstripmenu.dropdownitems(i).close
View 3 Replies
Sep 16, 2009
I have a map of the us that is broken into an html image map. (not asp). What I'm wondering is it possible to get the title of the refering link on the map?
[Code]......
View 1 Replies
Jan 23, 2011
I Imported 2 programs that I made into one solution. I made a "BIG" main menu (new windows form), put two buttons. I code one button to open up the first project (that works fine). I code the other button to open the project I imported, however it says that the name is not declared. Am I doing something wrong?
here is my code for the "BIG" main menu:
[Code]...
now only the "Original name of first project" appears to be not declared, if I delete "Original name of first project", then "the project I imported"is not declared and so forth. Note: These are not the exact names I called my forms. I'm just trying to explain it clearer.
View 2 Replies
Jul 21, 2011
I'm working on a very basic VB.net frontend for an Access database and have stumbled upon a problem.
Dim ds As DataSet
MaxRows = ds.Tables("Course_assignmentsDataSet.tblCourse").Rows.Count
i = 0
Private Sub Navigate()
txtCourseReference.Text = ds.Tables("Course_assignmentsDataSet.tblCourse").Rows(i).Item(1)
txtCourseName.Text = ds.Tables("Course_assignmentsDataSet.tblCourse").Rows(i).Item(2)
End Sub
I get the error that Object Reference is not set to an instance of an Object. I think this is because I haven't defined the DataSet as "Course_assignmentsDataSet"- the one I want to use- but I'm not sure how to do this.
View 1 Replies
Jul 16, 2010
My LiveView Property is named lstView and is called by this line:
[Code]...
The first reference to objListItem gets this exception: I am referring to the object as new but obviously not in the right way. objListItem is not Null when this line executes.
View 12 Replies
Aug 18, 2006
Does anyone know how I can include an existing dimensioned integer in VB code in a formula when using location indices (either R2C2 or R[2]C[2])?
I have integer Location set to the value 6 in some earlier programming steps, and now I'd like to be able to create other formulas and someimes use this Location integer into these formulas. More specifically at the RC and R[]C[] locations in formulas.[code]...
View 3 Replies
Feb 15, 2012
[code]...It is a multiline textbox, and I want to be able to enter different pieces of information (info1, info2, info3) into each line.
View 16 Replies
Mar 5, 2012
I have an app that pulls up a webpage that has a button on it with the following ( I CANT change the webpages, but I can change anything in the App.)
[Code]...
View 1 Replies
May 22, 2011
I use the following code to get the shortcut files in a folder and to list them in a Listview control. But is there a way to extract the path of the EXE to which this shortcut is referring to ?
vb.net
Dim di As New IO.DirectoryInfo("C: est")
Dim aryFi As IO.FileInfo() = di.GetFiles()
Dim fi As IO.FileInfo
[Code]...
View 2 Replies
Sep 29, 2009
I am developing an application which created a series of labels using code such as this below[code]...
View 3 Replies
Jan 22, 2009
I'm using VB.net 2005 and sql server 2000 i'm fetching the data into datagridview, but datagridview has several datasource depending on the "select case " Now can i export the data from datagridview without referring to dataset/datatable?
View 1 Replies
Nov 17, 2010
How would one remove an item from a ListBox and then remove that line from the TextFile and repopulate the ListBox with new data in Visual Basic.Net?[cod]...
View 2 Replies
Mar 11, 2011
Im creating a class that will have my common database functions. So for example I've created a function db_con in a class called db_functions.
How do i use that db_con function in for example my homepage vb code?
View 1 Replies
Mar 24, 2012
I have a Class, which I create an instance of in order to use, however I have a couple of functions (which don't really relate to the instance data) which I want to use when an instance hasn't been created.
Visual Basic .NET (2010)
Example of what I'm trying to do:
' Log a user into the system (this works)
Dim hedwig As New CustomSecurity
hedwig.Login("username", "password")
[Code].....
View 3 Replies
Oct 31, 2009
is there any way to extend upon a procedure itself?like i want to be able to do the following
Code:
public sub test()
msgbox(special())
end sub and it should popup a string, let's say "cool", plus i shld be able to use special() in every single sub but if we call special() from a function it should be rejected. how can that be done?
also, we should also be able to do the following
Code:
public sub test()
msgbox(specialvariable)
end sub whereby specialvariable is accessible by every sub.
View 3 Replies
Nov 3, 2009
I realize that this is a very basic question, but it's been a long time since I've played with VB. Why can't I call the Synch() Sub/Function in my CMMS_SCAD_CLASS class from my Main module? I get the following compile-time error:
'Synch' is not a member of 'ConsoleApplication1.CMMS_SCADA_CLASS.'
Main class:
HTML
Module Main
Sub Main()
Dim meterClass As New CMMS_SCADA_CLASS()
[Code]....
View 3 Replies
Feb 7, 2012
So, I am reorganizing a winform application I wrote to make it more readable and maintainable. The previous structure I used had:
1- a login form with some connection objects
2- an import process start form with some import objects
3- a log writer class that receives data from the import process and writes a log file at the end of the import process
The code quickly got too messy, so my goal now is:
1- a login form with only form events
2- an import form with only form events
3- a class with all the functions
Basically, my class with all the functions (3) looks like this:
Public Class MyProgramMainClass
Public Function test()
Dim testing As String = "test"
[Code].....
View 10 Replies
Nov 5, 2011
Public Class Form1 Public Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As IntPtr Public Declare Function GetProcAddress Lib "kernel32" Alias "GetProcAddress" (ByVal hModule As IntPtr, ByVal lpProcName As String) As IntPtr
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim hmod As IntPtr = GetModuleHandle(Nothing) 'Work Dim addrs As IntPtr = GetProcAddress(hmod , "TestFunction") 'Not work, always NULL why??
View 3 Replies
Sep 14, 2011
I want to be able to pull data from 6 text boxes with identical names (other than a number at the end) in a for loop here is the error:
[Code]...
View 2 Replies
May 31, 2011
How do I call a function in a visual basic class library?
View 7 Replies
Oct 21, 2009
the way i could use VBA to check if a function say function1 is present in class1. if the function is present display 1 else display 0.
View 2 Replies
Oct 28, 2008
I am working on this project and this question seems to be stupid, but I am not really getting the point.I have the following class:
Code:
Public Class ConnectedServer
Public MYPORT As String = "8000"
[code].....
View 13 Replies
Mar 6, 2010
I am new to vb.net and would like to be able to convert the following code to it's own function - either inside the current module or better yet in a seperate class.This code currently runs in the KEYPRESS event and ensures only numbers, decimal point, 2 decimals etc. are entered and not letters. Works exactly how I want it but would now like it in a function.I need this code in numerous text box controls but I would rather just call it somehow with a function.
View 3 Replies