Get The Referring Method In .NET?
Apr 3, 2009See this example:
''//file1.vb
Sub Something()
''//...
Functions.LogInfo("some text")
''//...
End Sub
[Code]...
See this example:
''//file1.vb
Sub Something()
''//...
Functions.LogInfo("some text")
''//...
End Sub
[Code]...
The redirect .NET uses to send users to my custom 404 page, wipes out the referringURL.[code]...
View 1 RepliesI 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 RepliesI 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 RepliesI�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
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]......
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.
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.
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
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.
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.
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]...
[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 RepliesI 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]...
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]...
I am developing an application which created a series of labels using code such as this below[code]...
View 3 RepliesConsider a MyForm class that contains a shadowed implementation of Show(). It also contains a CreateForm() method, which accepts an instance of the form and calls the shadowed sub:
[Code]....
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 RepliesHow 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 RepliesWhy would a .sln solution file open and appear empty in Microsoft Visual Basic 2010 Express - i.e. no windows showing projects and code files etc.When I inspect the file in a text editor, it contains references to vbproj files (which are present) which indicate that it should not appear as empty.No error messages are reported when the file is opened.
View 2 RepliesDoes calling the Dispose method on a Windows.Forms.Timer call it's Stop method? Or should I stop the timer before I dispose it?
View 5 RepliesI have a large problem with inheritance in vb.net. The problem is the following:
I have 2 forms => frmBase and frmChild
In frmBase i want to create a method Called StartWorking() and i want frmChild to inherit this method.
But here is the tricky thing: when frmChild.StartWorking is called i would like the following => without calling MyBase.StartWorking()
I want frmBase.StartWorking() to be executed first and after a test in frmBase.StartWorking if blnValue is true then frmChild.StartWorking has to be activated. if blnValue is false that frmChild.StartWorking cannot be activated.
I have nine pictures that I need to animate -I need to use the ToString method and a counter to concatenate a file name into a string variable from the Image.FromFile method. Once the counter reaches its maximum value, and the last picture is displayed, the counter should be reset to zero or one depending on how the first image file has been name. Also a static counter variable should be incremented in the time routine. what I have so far -- I know what I have to do; however, I just do not know how to code this properly.. Right now I have this going thru a button procedure but it needs to go through a timer.
[code]....
Write an overload for every numeric type or if possible constrain a generic extension method to just numeric types.
View 2 RepliesI just need to know what is the slight difference between them so I know which one to use everytime.
View 5 RepliesI will try to explain what I need.Let's say that I have a class like this:
Public Class Example1 Public Sub ToBeCalled()
[Code]...
When I am loading an Assembly dynamically, then calling a method from it, I appear to be getting the method from Assembly executing before the code in the method that is calling it.It does not appear to be executing in a Serial manner as I would expect. Can anyone shine some light on why this might be happening. Below is some code to illustrate what I am seeing, the code from the some.dll assembly calls a method named PerformLookup. For testing I put a similar MessageBox type output with "PerformLookup Time: " as the text. What I end up seeing is:
First: "PerformLookup Time: 40:842"
Second: "initIndex Time: 45:873"
Imports System
[code].....
Why does my the declaration of my string in the code result in the following error? Is there a workaround?
Code:
<script runat="server">
Protected Sub form1_Load(sender As Object, e As System.EventArgs)
Dim x As String = "</script>"
[code]....
Error: Statement cannot appear within a method body. End of method assumed.
Note: The following page did not fix my issue and instead resulted in the string </script> being output in my page. ( VB.NET hates </script> tag in string literal )
I am not sure whether this is a trick question?One of the object i have has 2 boolean properties, Standing and Sitting.I have a class called student with the 2 methods stated below- Am I coorrect is assuming that the first method draw() is affected by the standing property AND not the second method?Also the way it affects is that it draws an image when the the stugent is standing?
[code]...
What's the equivalent method in .NET of the Picture1.Scale (0,0)-(10,10) method in 6.0?
View 2 Replies