VS 2008 Can Call A Class From Main Form

Dec 14, 2011

As of the moment I have 24 buttons that are keys to a piano.24 of the button codes have a call method that calls the note to be played.24 of the private subs that are called have an .wav audio playback command within them. I was hoping I could move the .wav private subs into a separate class, and just call them from my main form, therefore cleaning up the lines of code I have at the moment. [code]That example only counts for one Button "The Key of C", and the audio file that is called with it. Multiply that by 24 and you get a big mess of repetitive junk.Can I move the audio subs into a class and call them from my main form?

View 16 Replies


ADVERTISEMENT

How To Call A Class From A Main Form

Mar 5, 2010

How would you call a class from a main form? In VB6 you would call a module by just simply calling the module name.

View 2 Replies

Call C# Form - Call The Form Called 'main'

Sep 22, 2010

I have a VB .NET 2010 application. I added a C# project to my solution. I tried to call the form called 'main'. However, I could not figure out a way to do that. What is the best way to do that? I Goggled, and did not find anything. Actually I noticed that my Developer converted everything to VB .NET.

View 5 Replies

VS 2008 Call Main Function From DLL?

Jan 18, 2010

We know that the DLL function can be called from our mainprogram and return value. I would like to know, when we run DLL function, can we call a sub in our mainprogram (from DLL function) and return a value to DLL fucntion.

View 3 Replies

Class Not Registered While Loading Main Form

Apr 1, 2009

We have a Dell laptop used to run an in-house VB.NET program. It got a virus. We had to wipe the hard drive and reinstall Windows from scratch. We use Windows XP Pro, which is what was installed on it before. But now our VB program won't run. After trying and despairing of getting remote debugging to work, I actually installed Visual Studio 2005 on the machine, just long enough to get information about what was making the program fail. And the failure was most peculiar. It isn't in our code. It's in the VB setup code that loads the main form. And it says, "Error loading form: class not registered."The gory details are given below. Now here's the strange thing. Not every VB.net program fails on this computer. And the program that fails, fails only on this computer; it has run successfully on several other Windows XP systems with .NET Framework 2.0 installed.[code]

View 3 Replies

Accessing Function In Alother Class From The Main Form?

Feb 12, 2011

I have a new solution with 5 projects inside. a data access layer, database, 2 class libraries, and the main form. These are all components that I had worked on to get to this point of combining into 1 solution. Now what I have run into is I can not the actual functions in the class libraries. I can get to the class level, but that is it. ere is a sample line of code I need to get working. Once I get this one line, the rest will be obvious: Temperature is on the main form. get for options is "Equals, GetHashCode, GetType", etc... Before this I had bult, compiled, and referenced these classes separately, and it worked fine. I know this is going to be an easy answer, I'm just not seeing it for some reason.

View 15 Replies

Handle Events From The Main Form In A Separate Class Or Module?

Feb 24, 2012

I've been searching for the answer for a while but can't find it yet. Basically so far I have a simple VB.Net form with one button.I would like to make a class or module that can handle events from the main form. This is my code so far but it doesn't seem to work.

View 6 Replies

VS 2005 Class Api Needs To Get A Handle On Form Elements In The Main Worker Thread

Sep 4, 2009

I have a standard windows application called winap. I have a com component which acts as an api to the winap. I have a class in winap call classapi which has all the methods that the api calls and all works well. The problem is that one of the methods in my class api needs to get a handle on form elements in the main worker thread. Whenever I try to access an existing form I keep getting null because the for exists in the main worker thread and my api call is in a seperate thread.

[Code]...

View 5 Replies

VS 2008 - Make A Class Link Into Main Code

Feb 7, 2012

I'm just wondering, how do i make a class link into my main code, it is in the same project so no need to reference it

Ive set up the the class and typed

code:

But they aren't linking/ working.

View 11 Replies

VS 2008 - Sub Main In Module Versus Shared Class

Feb 17, 2010

In VB6 I always wrote my apps using Sub Main as the starting point. I see in .NET I'm able to wrap it in a shared class (see [URL] for example). However, the downside is that I can't declare any class-level variables, because of course the class is never instantiated. Being shared, it limits what the code can do. So, any benefit to use a shared class and shared sub main which I'm missing here.

Otherwise it seems using a module (as in VB6) provides a lot more flexibility. Of course, I should also ask if "Application Framework" is really the way to go for real-world apps, or if it's only there for beginners and real-world coders turn it off and use Sub Main instead? If so, how are the events "UnhandledException" and "NetworkAvailabilityChanged" done if App Framework is turned off?

View 28 Replies

VS 2008 Class & DLL's - Create Scripts On Their Own And Allow Them To Interact With Main Sub

Dec 12, 2011

I want to start building my first large program. I want to create scripts on their own and allow them to interact with my main sub. I guess if I need a "plane" in my application, that could become it's own class? If I wanted to calculate "purchases", "money" I could create a DLL? I don't want to have to change things and have to recompile my entire application every time I want to change how something works for example.

View 5 Replies

VS 2008 Localization Globalization - Creat A 'sub New' In Main Class?

Mar 15, 2011

I'm busy creating a multi language application, so far so good. I've googled some examples, first problem I've encountered is setting it. Accourding the msdn documentation it had to be done BEFORE initializecomponent. I didn't know how, but found out you have to creat a 'sub new' in your main class.

[Code]....

View 1 Replies

Class - Call A Method In The Default Instance Form Instead Of Instantiating Another?

Nov 15, 2009

When an instantiated class calls a method in the parent form class, VB.NET starts a new instance of the form class instead of calling the method on to the active one.How do I tell it that I have just one instance of my form class, or that I don't want to create a new instance of the form and just call the method on the already active form?

View 2 Replies

VS 2008 How To Page Main Form

May 12, 2010

I have a SCADA program I'm working on, I need to add sum sort of paging when the user hits the page up/down button. I have about 100 station to show. I can fit 28 stations on one screen at 1280 X 1024.

View 4 Replies

VS 2008 - Matching Comboboxes With Main Form

Jun 13, 2010

I have a combobox on my main form and it lists geographical locations that the user creates. How do I make the combo-boxes on the sub forms match the one on the main form?

View 1 Replies

VS 2008 - Bunch Of Errors - Main Login Box And Then Fail To Show The Main Screen

Jul 28, 2009

My app works fine on the development machine and 3 other machines. However, some machines just show the main login box and then fail to show the main screen. There is no error message. I installed VS 2008 express on on of such machines and when i compile the project, the following errors appear:

Type 'Microsoft.Office.Interop.Access.Application' is not defined.
Type 'dao.DBEngine' is not defined.

[CODE]..........................

View 3 Replies

VS 2008 Move A Control From E.g. The Main Form To A Tab Page

Oct 21, 2010

What I'd like to do is in my application move a control like a groupbox or frame with content on it from e.g the main form to a tabpage on that same main form using code.

I can change the position of the control using it's location, but I haven't got a clue on how to move it from the main form to a tabpage, or from 1 tabpage to another.

-Is this at all possible and if so, how can it be achieved?

View 2 Replies

VS 2008 Open New Interface Panels In Main Form?

Sep 26, 2009

Ok Guys what id like to do is Have a set of buttons across the top of my form and when the user clicks one id like the botom of the form to change to reflect that click. Kind of like the Office 2k7 ribbon but apply that to the whole for

View 3 Replies

VS 2008 Return Value To Main Form AFTER Each Iteration Is Completed?

Aug 31, 2009

how to raise an event.I have a class that does some calculation using a For... Next loop, from 0 to 100.How would I return the value to the main form AFTER each iteration is completed? How would I raise the event? I have read the documentation but I can't wrap my head around this.

View 8 Replies

[2008] Show Image While Main Form Loads?

Feb 10, 2009

I have an app that connects to a remote database.The connection to the database is triggered by the form load event of the main start up form which prompts the user for user name and a password.Here is my problem:Sometimes it takes a number of seconds for the database connection to be established after the user has double clicked the desktop icon. this means that during this period it appears that no action is taking place until the startup form becomes visible.Some impatient users assume that nothing is happening and double click the icon again.What I want to do is to have a graphic image or something pop up on the screen immediately when the program starts that displays something like 'Connecting To Database, please be patient"

View 1 Replies

Call Other Files That Programmed To The Main Program?

Oct 8, 2010

i want to know how can i call other files that i programmed to the main program?

View 1 Replies

VS 2008 - How To Create Custom Shaped Form As Main Page Of App

Mar 16, 2010

I have need for a customised form as the main page of my app, what I'm looking for is to create an amoebic shaped form, something like this. I realize that my 'window' will by nature need to be rectangular and that i will need it to have no titlebar and transparent edges, also i will need to have 'regions' on this form that will allow the form to be closed and turned into a standard rectangular form. I have no idea where to begin with doing this but I hope and presume it is possible with vb.net. The image I have used is for illustrative purposes only, i don't plan to do exactly this (my app is a database not a media player for one thing) If having it is a breach of copyright in this context I will remove it.

View 39 Replies

VS 2008 - Show As A Drop Down Does Not Appear To Take The Focus Off The Main Form That Is Calling It?

Nov 3, 2009

Q1: How can i make it so that my window that i want to show as a drop down does not appear to take the focus off the main form that is calling it?

Q2: The form that is dropping down has the FormBorderStyle Property set to None - thus the window does not have a drop down shadow - how can I make the popup window have a shadow?

View 1 Replies

Call To Application.Run(New MyForm()) Not Working When Called Outside Sub Main?

May 2, 2012

I am using Compact Framework 3.5 on a Symbol MC50.In my Sub Main it first checks to see if a database exists. If it does, it shows a login screen using the following code:

Dim login As frmLogin = New frmLogin()
If login.ShowDialog() = DialogResult.OK Then
Application.Run(New frmMain())
End If

This all works correctly and, when I close frmMain, it exits the application as expected.However, if the database check in Sub Main fails, I call the ShowDialog() method of another form that is used to create and fill the database from a live server. Here is the code for calling this form:

If Not File.Exists(SETTINGS_LOCALDB) Then
databaseExists = False
MessageBox.Show("Local DB does not exist. The database must be created before using the application.")[code].....

All of this code is being hit and frmMain does indeed load. However, when I click the close button in the top right nothing happens, no event occurs. Its as though the Windows events are not occurring.

View 2 Replies

VS 2008 Different Ways To Call Another Form From A Parent Or Preceding Form

Aug 4, 2009

I need to know the proper way, or maybe I should say, the different ways to call another form from a parent or preceding form. I am currently using ex: formname.showdialog() to call my next form, but I am uncertain if I should be using that in every situation. [code] Whats the difference between these different methods? (ex: .showdialog() , .show() )I tried both of these to open a temporary form to retrieve a persons name from a database, so as the users progresses through my training program they can keep track of their scores.But, I also call other forms as I branch through my program, from the main page, to a secondary page, to a testing page, to a results page and then back to the secondary page

View 5 Replies

VS 2008 - Link Main Window Form With Menu Strip To Set Parameter

Apr 15, 2010

I an trying to create a GUI and I have added a menu strip, under the tools section of the menu strip, I have added a settings option. I want to click settings and have it open another windows form linked to the main windows form with the menustrip in order to set certain parameters. How do I link these two boxes using the settings menu strip?

View 1 Replies

VS 2008 : Making 'main Window' Form Acting As A Container For The Other Forms?

Mar 17, 2009

Am devloping an application with multiple forms, which reside on top of a main form. i.e the main application window. The 'child' forms do not need to be linked in any way as they do not pass information to the parent form, as all the parent form does is act as main window.Now I would like to know what is the correct way for the 'main window' form acting as a container for the other forms? So that all the smaller secondary forms stay focused on top of the main application form, that when the main window is minimized, so these forms should do also etc..

I have read other posts and they mention, leaving all the forms standard i.e. IsMdiContainer = False and then using form.showDialog() to call the secondary forms. This did not work for me as what happens is that as soon as I give focus to the main app form, the secondary form disappears underneath.I tired making the main app form IsMdiContainer = True and when it loads calling:

frmMemberForm.MdiParent = Me

Now this works, because I can click off the form and minimize the app etc and the frmMemberForm doesn't disappear. However if i close the MemberForm and reopen it, it looses this property and once again when it looses focus, it will disappear.

View 16 Replies

VS 2008 Make Main Form Inaccessible Until User Closes Dialog Box?

Apr 11, 2010

A program I'm developing launches dialog boxes to get information from the user. Right now, the user can still click on and manipulate the main form while the dialog box is open. How can I make the main form inaccessible until the user closes the dialog box?

View 2 Replies

Call A Function In Module And Get Result In The Main Thread Asynchronously

Mar 2, 2011

I have a function in a module that returns a datatable.I need to call that function asynchronously and get the results in the Main thread (Main Form) in vb.net.

View 2 Replies

Class Has Been Create By Main Class Only?

Feb 27, 2011

I'm try to create a class has been create by main class only by protect sub New but how do I create it ?

Public MustInherit Class Rune
Protected MustOverride Function Create() As Rune
Public Shared Function Factory(Of T As Rune)() As T
'I can't use "T As {Rune, New}" because Sub New isn't Public
'Return (New T).Create
End Function
End Class

[Code]...

View 2 Replies







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