.net - Capturing Error Events?
Feb 9, 2012
I was creating some complex applications in Visual Basic .NET 2008 and since they are in the testing phase right now, people manage to find an error or two every so often that causes the program to crash. The problem is that there is a tracking piece to it that logs who is currently using the programs. When a user logs in, it logs that they are currently logged in, and if the form close event is fired, the log is deleted to show that they have closed it.
Now my problem comes whenever the form crashes from an error since it won't trigger the close event and therefore makes the log become inaccurate. My question is if it is possible to capture any error that the form would have in the form of an event?
View 2 Replies
ADVERTISEMENT
Apr 30, 2010
I am trying to modifying the "Math Quiz" tutorial to be more user friendly.
The initial tutorial does not consider the users efforts to answer the math problems as quickly as possible.
The problem is that you must use the mouse or tab key rather than the "enter" key to move to the next control after answering. I believe using the "Enter key to be much more intuitive.
Therefore, I wish to modify the program to either:
1. Check the KeyPress event of the NumberUpDown controls to watch for the "Enter" key to be pressed, and if it is, check to ensure that the current NumberUpDown control is not empty (= Nothing) and if both are True, to then TAB to the next control in the TAB order; OR
2. Uses the PreviewKeyDown event to transpose the "Enter" into a "Tab" automatically so the application will then TAB to the next control in the TAB order.
With all of the new changes to VB 2010 from the last version I actually used professionally (VB6), things are REALLY different, so I no longer know how to accomplish this same task in the new manner. especially if it contains working CODE, because I have always learned better the first time from an example. here is my version of the tutorial Code:
'--- Create a Random object to generate random numbers.
Private objRandomValue As New Random
'--- The Integers will store the numbers for the
' addition problem.
[Code]....
View 4 Replies
May 21, 2009
Is there a way of capturing the current contents of all the variables in a VB .NET application when the .exe crashes?Ideally I would like to write out the current contents of all variables to a flatfile when an .EXE crashes.
View 2 Replies
Mar 21, 2009
- Assume there is a form called form1 in the "view" of the MVC - Assume there is a class library called Controller1 in the "Controller" o fhte MVC. Assume there is a button called "btn1" in form1. form1 and controller1 is in two different projects.
[Code]...
View 2 Replies
Sep 8, 2009
I have an object, say Order where if an error occurs, it raises the ErrorOccurred event. If I'm running some code in say, the codebehind for a .aspx page with an public Order registered as WithEvents and I want to check to see if an error has occurred before I run more code, how do I do this? I can't simply check theOrder.ErrorOccurred. Do I have to create a local boolean flag that switches over in the event handler (OnErrorOccurred)?
Example:
Public WithEvents theOrder As New Order
Public Sub DoStuff()
theOrder.DoSomething()
If theOrder.ErrorOccurred Then
[code]....
View 3 Replies
Nov 4, 2011
I am creating a question and answer form and I have created a couple of error message boxes that will show up on different events. With the first set of code below it is supposed to show up when a user doesn't check any radio buttons and clicks the next button, however when the message appears even if they click ok it moves onto the next question without letting them chose an answer. For the second set of code it asks if a user wants to retry but even if they click X to cancel the message it still reverts back to the main page.
If rbAnswer1.Checked + rbAnswer2.Checked + rbAnswer3.Checked = False Then MsgBox("You must select an answer to continue.", _
MsgBoxStyle.Critical Or MsgBoxStyle.Question, _ "Error")
MsgBox("Are you sure you wish to retry? All current progress will be lost", _
MsgBoxStyle.Question Or MsgBoxStyle.Question, _
"PowerPoint Quiz")
View 2 Replies
Dec 8, 2011
I am auto generating data grid and I am using check box in Data grid View,Now i am invoking check box state changed event but it produces the following error Handles clause requires a With Events variable defined in the containing type or one of its base types.
Here the code
Private Sub PRNT_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles PRNT.CheckedChanged
Some Stuff.
End Sub
View 2 Replies
Oct 13, 2011
I have been trying to implement the jQuery weekcalendar using .net. What I can't seem to figure out is why weekcalendar states events.events is undefined after I make an ajax call to a webmethod I created which returns JSON. Below is the relevant code:
[Code]...
View 1 Replies
Aug 2, 2009
I want to make Keybord events and mouse events for learning and educational Purpose.
1. In Form any object like A "picture box" move by Arrow keys .
2. Picture Box Contain many Picture i want change Picture With next and Previos By Arrow keys.
3. I contain Voice of alphabet in Mp3.When i Press any button in textbox then its work.
4. Mouse Pointer Change My Own.
5. I click any Object or any thing By mouse its noice clicking sound like Tik Tik Tik.... Question No 3 is very hard to do . but not im possible
View 12 Replies
Jun 4, 2011
I want to capture a still picture in any format like .png,.jpg,.bmp etc. using a webcam.And want to save that in directory.
View 3 Replies
Mar 14, 2010
How can I capture text from cmd.exe window? Tried GetWindowText, but this only returns the title.
View 6 Replies
Apr 22, 2010
I have a delegate and its event in C# as below:
public delegate UsernameCredentials UsernameRequiredEventHandler( object sender, string endpoint );
public event UsernameRequiredEventHandler UsernameRequired;
On Converting the above code in VB.Net as follow :
Public Delegate Function UsernameRequiredEventHandler(ByVal sender As Object, ByVal endpoint As String) As UsernameCredentials
Public Event UsernameRequired As UsernameRequiredEventHandler
I am getting error on the above line saying that "Events cannot be declared with a delegate type that has a return type".I understand that this is not supported in VB.Net.
View 3 Replies
Aug 28, 2011
I'm trying to convert some C# code to VB.NET. I have the following in C# (which works)
[Code]...
View 1 Replies
Jun 16, 2010
I am using a DataGridView, which is bound to a dataset. There is a bindingNavigator as well.
when a user deletes a row by clicking "bindingNavigatorDeleteItem" button, I am trying to get the row being deleted.
private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
{
int crow = gridEventType.CurrentCell.RowIndex;
but it returns the newly selected row AFTER deletion of a selected row.
so, If I have two rows
0
1
2
and I delete 2
crow is 1, not 2.
Am I missing something here?
2. How do I know whether certain rows are modified in datagridview?
View 3 Replies
Oct 19, 2006
I am trying to make a simple personal program and cannot figure out how to capture a section of the screen.I want it to work like prt scr does except it captures a specified rectangle instead of the entire screen. I am thinking I have to use Drawing.Graphics but am not sure.
View 11 Replies
Feb 8, 2010
The below is my program so far
Public Class Form1
Private Display As Boolean
Private WithEvents tmr As Windows.Forms.Timer
[code]....
Upon clicking the button a series of letters are displayed to the screen.I would like to be able to capture the time taken to press the letter shown.
View 8 Replies
Dec 7, 2011
Okay, so I know how to capture a screenshot of the Active Window, but if the active window is a game, then the screen is just black. What do I need to do to be able to also capture ingame screens?
View 3 Replies
Dec 1, 2009
I was wondering if there is an easy way to analyse sound that is sent to the speakers (just before it's played). For example when playing a song in winamp or windows media player. Or is it easier to write plugins for those programs to form an interface with your own program?
View 2 Replies
Aug 9, 2010
I have a datagridview (unbound). Fields are Name, Family Name and Phone No and a checkbox colum.
There are ten rows in that DataGridView.
There is an OK button
I need to get message of showing which rows user has checked. The message should appear when user clicks OK button. There could be several message, checking each row one by one, in a loop.
I am not able to get this message. I tried following code in OK button
Dim strCB As String = dgvChooseQs.Rows(0).Cells(3).Value.ToString
Cell(3) is my checkbox. Donot consider Rows(0), at the moment I am just checking value at row 0
View 2 Replies
Jan 16, 2008
I have read and tried a dozen or more examples of trying to capture the Enter key in a datagrid, but I have yet to find something that works. My scenario is :
ds.Tables.Add(dt)
dt.Columns.Add("Inventory Nr", GetType(System.String))
dt.Columns.Add("Cases", GetType(System.Int32)) Inventory Nr in the next row.
[code].....
View 1 Replies
Dec 18, 2010
I'm currently trying to Capture through DirectSound, I've been trying toying around with WaveLib(Ported to VB) but this is very confusing. Anyway, I cant figure out how I am supposed to do this and would like some assistance. The end goal of this project is to: Record Microphone > Encode with Speex Codec > Send over UDP > Decode > Play on Speakers
View 3 Replies
Nov 18, 2011
i use with this code: Dim bounds As Rectangle
Dim screenshot As System.Drawing.Bitmap Dim graph As Graphics bounds = Screen.PrimaryScreen.Bounds
screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
graph = Graphics.FromImage(screenshot)
graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
PictureBox1.Image = screenshot
But when I try it in games,it shows only a black picture.
View 4 Replies
May 28, 2007
I would really like to get some VB.net program code for still image capturing using a Webcam.I've searched the web for quite a while now but did not get any codes. Currently i have a code for capturing video. In that code an image can be captured, but only with 640 X 480 resolution (Maximum Video resolution for my web camera). The WM_CAP_DLG_VIDEOFORMAT dialog box only allows the resolution to be set up to 640 X 480.
[Code]...
View 6 Replies
Jul 18, 2012
I'm just wondering if it's possible to add the mouse when capturing the screen or monitor in vb.net?
because I'm doing a project that would record the screen and I'm actually successfull doing that by capturing the screen and include it in a timer, but my only problem is the mouse or the cursor isn't showing.
below is my sample code.
Dim ScreenSize As Size = New Size(TotalScreenWitdh, MonitorHeightArray(0))
Dim BMP As New Bitmap(TotalScreenWitdh, MonitorHeightArray(0))
[Code].....
View 5 Replies
Aug 26, 2008
We are using avicap32.dll for capturing Pictures from Webcam,and we want to display the list of connected Webcam names but we are only able to get the driver name for webcam by using capGetDriverDescriptionA method. Is there any method to get the name of the webcam like "asus W120"
View 5 Replies
Nov 21, 2010
I'd like to start by saying that simply though searching, DreamInCode has taught me alot about VB.NET. In fact, I would imagine without DIC as a resource, I probably wouldn't have been able to move forward and learn most of what I know now, just because I got stuck on some things here and there.Anyway, I searched around for information regarding how to "capture" a minimize event in VB.NET. I am working on the GUI for an application that I would like to have minimize to the system tray. Currently, instead of accomplishing this with the minimize function, I do it on the FormClosing event like this:
Private Sub MainFrm_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
'Cancel the attempt.
[code]....
That code works, and upon making the form visible again with Me.Visible = True the form is restored to its original position. However, prior to the form being hidden, the window manager draws a minimize and restore effect before eventually hiding it. Any change to the WindowState _after_ hiding the form does not appear to have any effect, so when the form is unhidden it is still minimized.is there a way to capture Minimize events, and when captured, is it possible to cancel them in a manner similar to what I did with the FormClosing event?
View 2 Replies
Aug 3, 2011
I'm stuck here in a code that requires me to capture the printer name and storing the file name as well.
The code is hown as below:-
Dim dir_info As New DirectoryInfo(strDirectory) 'the directory is D:jeremyPrint ServicePrint ServicePL"
dInfo = New DirectoryInfo(strDirectory)
[Code]....
View 2 Replies
Mar 20, 2012
I have an application that primarily moves files from one location to another. I need to get the user's response when asked by Windows if they would like to overwrite or rename the new file because it already exists in the destination selected on the form. I basically need to receive a boolean value so i can update the transaction logs.[code]
View 5 Replies
Apr 3, 2011
Now i'm capturing frames from webcam and send them via UDP, it's not realtime. Is it streaming?
View 4 Replies
Sep 3, 2005
how I can detect the mousedown,mouseup etc even outside my application using vb.net? I have an API here,but,doesnt seem to work the way I expect it to..
VB
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
[Code]....
Should that API be modified to be used or something?? or what should I do to capture the mouse click events..both left and right buttons...
View 13 Replies