Click here to Skip to main content
15,922,015 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Run a Visual C++ program from VB Script and get a return value ?? Pin
Dave Kreskowiak28-Jan-04 3:43
mveDave Kreskowiak28-Jan-04 3:43 
GeneralRe: Run a Visual C++ program from VB Script and get a return value ?? Pin
bjolletts28-Jan-04 21:09
bjolletts28-Jan-04 21:09 
GeneralDatagrid related question ? (vb.net) Pin
Tridip Bhattacharjee27-Jan-04 0:38
professionalTridip Bhattacharjee27-Jan-04 0:38 
GeneralRe: Datagrid related question ? (vb.net) Pin
KennyGreg27-Jan-04 11:30
KennyGreg27-Jan-04 11:30 
GeneralReading image data within an IPicture Pin
Toxsophilus26-Jan-04 22:47
Toxsophilus26-Jan-04 22:47 
GeneralExport to microsoft excel Pin
Lim Goh Tong26-Jan-04 22:20
Lim Goh Tong26-Jan-04 22:20 
GeneralVB.NET and Images Pin
prasams26-Jan-04 17:23
prasams26-Jan-04 17:23 
GeneralForm problem Pin
RJGCarey26-Jan-04 11:43
RJGCarey26-Jan-04 11:43 
I am migrating a large VB.6 solution to VB.Net and have encountered a problem that I haven't been able to solve.
It has been my habit for some years to notify myself of errors by putting up a new form and write to it the location and type of error that has occurred. This works nicely in VB.6.

I use this class in an error routine, such as.
Catch ex As Exception
Err.Showit("clsBars", "DoNewMinute", ex.Message.ToString)
End Try

In VB.Net the form comes up and is correctly sized and positioned and the error message is written to it.
When you pass the cursor over the form it turns to an hourglass. You can not minimize, maximize, close or drag the form.

If you use this class from a command button on another form with this code
Err.SetUpForm()
Err.Showit("This is a test")
the form behaves normally.

What am I missing?
Thanks
RCarey

Here is the code for my error class.(alias Err.)

Public Class clsError
Private dG As System.drawing.Graphics
Private dFt As System.Drawing.Font
Private dBr As SolidBrush
Private dFm As StringFormat
Private dX, dY As Integer
Private lineCount, maxLines As Double
Public Sub SetUpForm() '1/14/04
Dim dbgString As String
Try
frmError = New Form3 '<form3 is="" a="" ordinary="" form="" with="" no="" added="" objects
="" frmerror
="" .left="0
" .text="Errors"
="" .top="384
" .width="1000
" end="" with
="" frmerror.show()
="" catch="" ex="" as="" exception
="" dbgstring="ex.Message.ToString
" stop
="" try
="" dg="frmError.CreateGraphics
" dft="New" system.drawing.font("ariel",="" 7,="" fontstyle.regular)
="" dbr="New" solidbrush(color.black)
="" dfm="New" stringformat
="" dfm.formatflags="StringFormatFlags.MeasureTrailingSpaces
" maxlines="Math.Round(frmError.ClientSize.Height" dft.getheight)
="" sub
="" private="" sub="" clearform()="" '1="" 14="" 04
="" dim="" string
="" dg.clear(frmerror.backcolor)
="" linecount="0
" public="" overloads="" showit(byval="" instring="" string)="" if="" frmerror="" nothing="" then="" 'set="" up="" the="" form
="" setupform()
="" if
="">= maxLines Then
ClearForm()
End If
Catch ex As Exception
dbgString = ex.Message.ToString
Stop
End Try
Try
dX = 0
dG.DrawString(inString, dFt, dBr, dX, dY)
lineCount += 1
dY += dFt.Height
Catch ex As Exception
dbgString = ex.Message.ToString
Stop
End Try
End Sub
Public Overloads Sub Showit(ByVal inClass As String, ByVal inProcedure As String, ByVal message As String)
Dim dbgString As String
Try
If frmError Is Nothing Then 'set up the form
SetUpForm()
End If
Catch ex As Exception
dbgString = ex.Message.ToString
Stop
End Try
Try
dX = 0
dG.DrawString(inClass, dFt, dBr, dX, dY)
dX = 50
dG.DrawString(inProcedure, dFt, dBr, dX, dY)
dX = 200
dG.DrawString(message, dFt, dBr, dX, dY)
lineCount += 1
dY += dFt.Height
Catch ex As Exception
dbgString = ex.Message.ToString
Stop
End Try
End Sub
End Class


RCarey
GeneralShow Open file dialog after MDI window is shown Pin
.NET Guy26-Jan-04 11:37
.NET Guy26-Jan-04 11:37 
Generalexcel to C++ Pin
Goh Hui Beng26-Jan-04 4:02
Goh Hui Beng26-Jan-04 4:02 
GeneralRe: excel to C++ Pin
Lim Goh Tong26-Jan-04 22:03
Lim Goh Tong26-Jan-04 22:03 
GeneralCrystal Report - Error... Pin
Sarvesvara (BVKS) Dasa25-Jan-04 23:47
Sarvesvara (BVKS) Dasa25-Jan-04 23:47 
GeneralGet shared folders Pin
radhika8125-Jan-04 18:02
radhika8125-Jan-04 18:02 
GeneralMap &amp; disconnect drives Pin
radhika8125-Jan-04 18:00
radhika8125-Jan-04 18:00 
GeneralRe: Map &amp; disconnect drives Pin
Mike Dimmick26-Jan-04 3:16
Mike Dimmick26-Jan-04 3:16 
GeneralGet all directories and subdirectories Pin
ltt1925-Jan-04 13:18
ltt1925-Jan-04 13:18 
GeneralRe: Get all directories and subdirectories Pin
Colin Angus Mackay25-Jan-04 13:26
Colin Angus Mackay25-Jan-04 13:26 
GeneralRe: Get all directories and subdirectories Pin
ltt1925-Jan-04 13:41
ltt1925-Jan-04 13:41 
GeneralRe: Get all directories and subdirectories Pin
Colin Angus Mackay25-Jan-04 21:28
Colin Angus Mackay25-Jan-04 21:28 
GeneralRe: Get all directories and subdirectories Pin
ltt1926-Jan-04 4:05
ltt1926-Jan-04 4:05 
GeneralRe: Get all directories and subdirectories Pin
Colin Angus Mackay26-Jan-04 10:14
Colin Angus Mackay26-Jan-04 10:14 
GeneralRe: Get all directories and subdirectories Pin
-Dr_X-25-Jan-04 14:28
-Dr_X-25-Jan-04 14:28 
GeneralRe: Get all directories and subdirectories Pin
ltt1926-Jan-04 4:08
ltt1926-Jan-04 4:08 
GeneralRe: Get all directories and subdirectories Pin
-Dr_X-26-Jan-04 4:34
-Dr_X-26-Jan-04 4:34 
GeneralRe: Get all directories and subdirectories Pin
ltt1926-Jan-04 5:32
ltt1926-Jan-04 5:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.