I've created a dialog which I'd like to popup from any function or sub in any class or form that I have in a project. It would nice to have it work exactly like a messagebox except it's got a progressbar and a cancel button on it. It's job is to display the progress of other functions so it should just stay open until I close it or the user selects cancel.Now I've found many of the basic examples on the net and have got the dialog working exactly as they have shown it. The trouble is that the examples are using a counter or thread.sleep which simply adds +1 in the DoWork sub. In other words, it validates that a worker thread can update a progressbar but it's a closed loop that only exists in the dialog's class.The examples don't show how to call an unkown function in another class dynamically, they're simply a hard coded 1+1 in DoWork. To me it's not a real world example because it doesn't show how to plug into the dialog or get a communication stream from other classes and functions that are running and wanting to increment the progressbar.[code]
eg: dim classobj = xyz("CLASS_NAME") ' where classname is a valid class name and dynamically raising a known method of that class on that newly created object or class reference.
I need to create unit testing project for my current website. The currentw ebsite si written in VB. All unit testing examples are using interface to create mock object. My current VB class does not implment any interface. Can I add interface and implement it to my current class and functions without affecting or changing codes to any pages in my website that call the functions? For examples my current class is like:
Base class has one field to hold numeric balance value. With 2 methods that accept arguments for adding and subtracting the new input calculating new balance. Sub class has four fields dates, transaction, memo and amount.I have a deposit form, and withdraw form. Each time one transaction is entered it creates an object with sub class fields, then adds to the account collection. My problem is not understanding how to call the deposit/withdraw method and pass the current transaction amount back to the base class to alculate the new balance. Does anyone have any links to information/tutorials on how to perform something like this? As you can see with my code I have tried various different approaches without any success.
I need to dynamically call web service! For this I made simple web service Service1.asmx
Then I created the proxy class for the Service1 Web Service, I use the WSDL.exe utility and following command at the command prompt: wsdl /language:VB /out:myclass.vb http://localhost:3245/Service1.asmx?WSDL
This command create class myclass.vb. That class I include in my Windows Application project, but when I do this I get lot of errors.
This is the how created class look like:
Imports System Imports System.ComponentModel Imports System.Diagnostics Imports System.Web.Services
I have application in VB.net that have two different form (Form1 and Form2). Now I need to examine some condition and if condition is true then i set Form1 for startup for and if it not then i set Form2 for startup form.So is there anyway to dynamically call startup form?
I'm having one basic aspx script that needs to load some "plugins". Every plugin has its own settings and it should perform different logics. What i'd do in php is create a class for each plugin, load that class, pass the settings file to it and call some method on that class that would give me some output. But is it even possible in vb.net? I'd need to have multiple files with multiple classes, load those files, depending on the plugin name and call some method on them to parse that plugin's settings.
Is there a way to call functions within a class upon instantiation of that same class? Basically, I have functions within a class, but I want to automatically call some of those functions simply when there is an instance of the class created.
Basically, I have this structure:
Dim instance as new class instance.function1 instance.function2
I working on a project that includes to call a certain type of method to each control, i have this code:
Private Sub txtBcNum1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtBcNum1.KeyPress If Char.IsDigit(e.KeyChar) Or e.KeyChar = Chr(8) Then
[Code]....
I have 15 textboxes( txtBcNum1,txtBcNum2,....,txtBcNum15 ), what's the best way to call this function inside KeyPress method on each textboxes with out manually adding it to KeyPress method?
How do I dynamically call a function with delegates by passing a string to a background thread in VB.NET?
Currently my code is this
Public Sub invertImageBK(ByVal image As Bitmap) Dim snxl As System.ComponentModel.BackgroundWorker = createBW() snxl.RunWorkerAsync(New ImageProperties(image.Clone, "invertImage", Nothing))
Am a geriatric coming back to programming after a decade's rest. Keeping it very simple. An empty form. As the form loads, create a Black button (OK) and also create a class which itself creates a single Cyan button. Am using VB 2010 Express. When I run, it creates the Black Button but not the Cyan (i.e. the one that is generated by the class).
So Im iterating through the properties of a class. For each property Im iterating through a datatable until I find a column name with the same name as the property.
No worries so far, here's the isse: Once I've found a match I want to set the class's property to the value in the datatable but I'm having difficulty referencing the property as it has to be done through a variable.
Code: Dim per As New Person Dim t As Type = per.GetType For Each p As PropertyInfo In t.GetProperties
I'm making a little program in where i'm trying to invoke a method from a class dynamically with so called Reflection.The class I'm trying to call is called ContactList and i try to invoke the method in this class called count. The assembly itself is called Contact.ExeNow I have the following code:
Public Function InvokeContacts() As Integer Dim ContactsAssembly As Assembly = Assembly.LoadFrom("Contacts.exe") Dim Mycontactlist As Type = ContactsAssembly.GetType("ContactList")
I have this class Framework.Asd.Human with a public empty constructor. and i want to be able to dynamically create an instance of it from a string input "Framework.Asd.Human". Is this achievable? (in java and C#)
I'm trying to create a application using VB.Net 2008 and my database is SQL Express 2005 (currently on visual studio installation)Here's my codeThis is on code on class (I'm using data adapter and data set)
Imports System.Data.SqlClient Public Class Code1 Dim connection As New SqlConnection(Mod1.connString)
[code]....
In the other form its works, but its just for show the data/table itself. in this case i want to make validation for login form. i want user get a notice when they user name and password are wrong.my code doesn't works, is there something wrong?
I've got a email program that calls a VBScript event handler on certain interesting events. I want to call a method on an object I've written in a VB.net class library within the VBScript event handler.Is it possible to do without registering the .dll or using the GAC, but maybe just referring to the path of the DLL.Or could the object be served by another .net program which is running at the same time?
have inherited a Datagridview column called DatagridviewNumBoxColumn, I have added a property called FormatStringMy question is i want to access the property of format string value from another class.
Public Class DataGridViewNumBoxColumn nherits DataGridViewColumn Public m_FormatString As String