Execute One Form From Other?
Jun 6, 2011[code]...
how Can I call privileges.vb from the btn_next_begining?
[code]...
how Can I call privileges.vb from the btn_next_begining?
Can anyone think of a clever way to execute a piece of code every time a form opens, application wide? I have an app with about 45 screens, and I don't want to drop code in each form load event.
View 7 RepliesCan anyone think of a clever way to execute a piece of code every time a form opens, application wide? I have an app with about 45 screens, and I don't want to drop code in each form load event.
View 12 RepliesI have a stored procedure that clears student accounts to showed that they have paid their bills. I am trying to create a form in vb.net that allows them to enter a parameter and then execute the stored procedure.
View 9 RepliesIs there a way to execute a block of code once the form is opened? What is the event procedure required for this?
View 7 RepliesI want to develop a program using VS 2010 Pro, VB and .NET 4.0 to run on a Windows standalone computer.The program will be loaded by another program that checks for a text file in a directory.When that file exists, the program I want to develop will be started and it will process the text file.The new program will not have any buttons or dialog boxes, it will simply display the progress of the processing of the text file and then it will simply terminate and exit.
I know I can start the processing by putting code in the LOAD event for the form, but i want to make a new class for all the processing to start from and have the new class perform all of the steps necessary to complete the processing of the text file.Of course this new class will use other classes to do all of the different processing steps.How do I execute that new class from the Form LOAD event?
I start my program with a splashscreen and as soon as the mainform is loaded, databases are loaded and data is crunched it shows the form with everything on it. All very nice. But now comes the trick. The form has a strip of 5 tabs on it. The active tab is shown and directly accesible but as soon as i click on the other tabs it needs time to draw everything and calculate its content. And when i have clicked through all of them everything is finally up to speed. How can i speed things up in such away that all this predrawing etc is done in the background just as i got it to work with my mainwindow and its first tab?
I have this in the load sub:
For i = 0 To TabControl1.TabCount - 1
TabControl1.TabPages.Item(i).Invalidate()
Next
But some how this does not do the trick.
I have a windows application. I would like to run a statement while exiting my application. I tried adding my statement on FormClosing event. but it only executes if the application is closed properly. However, If the application is closed via task manager or system is restarted or logged out, etc. then the statement in closing or disposed event is not getting executed.
Private Sub Form1_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
MsgBox("disposed") End Sub Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing
MsgBox("closing")
End Sub
can some one tell me how to get my statement executed even the user tries to log out or shut down or application is closed via task manger.
my question is how can I execute these VBScript codes inside the Windows Form (of course in a button click event). I don't want to execute them by pointing to the VBS file, I want them to be in the EXE file when I compile the form so if I hand out the form to someone else, they cannot modify the scripts.
View 14 RepliesI have a BIG piece of code that looks like this: Public Sub mnuNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuNew.Click ' Lots of code End Sub I need to execute this subroutine from another part of the same form's code. This should be fairly simple but I haven't been able to figure it out. How do I do this?
View 2 RepliesI need to execute some code after the form is loaded and shown on the screen, how can I do that?
View 2 RepliesPublic Class aaMyForm
Inherits Windows.Forms.Form
Added some controls. Build it, add the .DLL as reference to my other project.
In my other project:
Imports MyLib
Public Class XForm
Inherits aaMyForm
The events from aaMyForm execute correctly but the controls added to it are not shown on XForm. I have found some info about set Modifiers Protected in order to be able to change the functionality of the controls but havent found anything about why the controls aren display on the XForm.
[Code]...
how can i get this code to return all values instead of just the first value ?
Problem that you may have when dealing with two objects that are raising some events. Here, to make it obvious, I am closing the form, but the problem can be experienced with any other 2 classes event. First, what is the problem !
Let suppose that by pressing a button, you want to raise a custom event, then execute a method and then close the form
In that case, you may use a code similar to this
Event BeepIt()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
RaiseEvent BeepIt()
[CODE]...
i have a stored procedure that updates TableA with data from TableB when i run it from SQL managment studio it workes, so the SP is error FREE, all i need is to execute this from a button click event.
i tryed this:
Try
Dim cnn As New SqlConnection(My.Settings.sqlCn)
Dim cmd As SqlCommand = cnn.CreateCommand
[Code]....
I have code I want to execute only if the EXE is not in the IDE. How can I determine when I'm running outside the IDE?
View 8 Repliesi just want to ask why this error mean?InvalidOperationException was unhandled by user code//The provider could not determine the String value. For example, the row was just created, the default for the String column was not available, and the consumer had not yet set a new String value.
View 8 RepliesI've been running the exe file ok but recently I got this error. I suspected it could be because of the windows update which the IT technical had run earlier. Anyone knows what's the cause of this error? Please see the attachment for the error.
View 1 RepliesI have a sample.cmd file that has the following code.
dir/b/p D:Satheesh > TableOfContents.txt
When I run the bathc file seperately I can able to get a text file that contains all files in the folder.
But when I execute the cmd file from VB code using Shell function, I am not getting the text file created.
I have a BindingNavigatorMoveNextItem_Click event and I want to execute btnSave_Click() event.. its asking for e args, what do I use as args?em.EventArgs) Handles BindingNavigatorMoveNextItem.Click
View 4 RepliesALTER DATABASE test SET ENABLE_BROKER this is the sql query i wish to execute while program is executing.because i do not want to everytime i change computer also need open sql management tool to execute this query rath
View 3 Repliescatch statements - it works well just checking my disk drive for a file, if an error is thrown then I open the disk tray and ask them to put the disk in, click OK on the message box and it performs another check for the file, if this fails the button that starts all this is disabled on my main form (the code is shown below).
Okay, so my problem is I'd like to have the message box pop up and the have the drive open up (using an API which I have) either at the same time or in the order of: message box then drive open. I can see two ways to do this: Have the commands happen at the same time (Can you even do this?) OR Have the message box appear and then open the disk drive (but how I could achieve this I don't know as the message box waits for the user to click OK... I originally though of starting a timer just before and getting it to open the disk drive tray in the tick event,
Code:
Public Class Form1
'open cd-rom tray API
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal _
[Code].....
I created a *.bat file : osql -Usa -Paugust -SNgocThach -iMYDATABASE.SQL When it run at cmd, it ok. My database has just been setup. Now, I want to setup my database use VB.NET. How can i do
View 1 RepliesFor example I got Form1. And I want to get a jarfile inside it just like its possible for .swd and .pdf files.I thought of something like a webbrowser, going to a page with the jar file, but that Isnt really brilliant as the webbrowser might be slow, or cause problems.
View 1 Repliesfor example there is a file named abc.exe in c:
what would be the code for executing this file?
My basis of my programForm 1 has functions, which are controlled through button1 which sends an email, At the end of the send email function I have Dialog1.ShowDialog() Which opens Dialog1 to say "Email has been sent" With a button, I want this button to execute the whole program, How do I do this?
View 2 RepliesI'm trying to play a video file by executing the player file and calling the "open" method. Although it works perfectly on GOM player, it does not work in VLC player, Windows Media Player and BS player. I tried other methods instead of "open" such as "url", "play", etc. but they are useless. Below the working code is shown:
Dim PlayerPath As String = "C:Program FilesGRETECHGomPlayerGOM.exe"
Dim process As Process = New Process
process.StartInfo.FileName = PlayerPath
[code]....
about execute a program, what do I have to do in order I can make the program run on any other computer. I have a program on a floppy disk, and I have a copy on my desktop. when I run the program on my desktop it always say "File not found", when I put the floppy disk it's working fine. So, is there anything I can do, to make it run on any other desktop without saying "File not found"
View 10 RepliesI'm trying to read data from database.
If objReader.Read = True Then
If objReader("cell") IsNot DBNull.Value Then
Me.txtContact.Text = Trim(objReader("cell"))
[code]....
Problem is, no data displays if cell is empty.
How do i write in If not on vb2010??
View 1 Replies