Does anybody know if there is a way to make visual studio open files in 'view code' mode instead of 'view designer' when a file is double clicked in solution explorer? Dragan
Dragan Matic
Posts
-
open file in 'view code' instead of 'view designer' on double click? -
InvalidPrinterException when printer is installed and working - only with HP LaserJet 1010 seriesI am having a problem with with printing from .Net 2.0 on HP LaserJet 1010 printers. Occasionally (sometimes once a month, sometimes once a day) printer gets 'blocked' in such a manner that it can not print anything from .net 2.0. When printDocument.print method is invoked, it throws InvalidPrinterException, even if printer has just been selected from printDialog. Printer is online and working (everything else can be printed on it), only printing that goes through .net is blocked. The problem seems that printer name is not recognised even if it is returned by PrintDialog, and printDocument.PrinterSettings.IsValid is false. Even a simple example like this doesn't work: printDialog1.Document = printDocument1; printDialog1.ShowDialog(); // after printer gets blocked, isValid is allways 'false' if (printDocument1.PrinterSettings.IsValid) printDocument1.Print(); else MessageBox.Show("Error!"); The way to 'unblock' the printer is to simply change its name (printers and faxes / right click on printer / rename) or reinstall the printer. After that printer gets unblocked and works for some time until it gets blocked again (while it is 'blocked', it can still print from other programs, only .net programs are blocked). This only happens with HP LaserJet 1010 and 1018 printers. All the other printers work perfectly. On some computers these printers get occasionally blocked, while on some computers printers work perfectly. Printers are installed with newest drivers, .net is 2.0 with service pack and computer operator works as an administrator for a local machine. Any idea why this blocking is occuring? Tnx in advance Dragan Matic
-
Which event is occuring in DataGridView in edit mode when user pressed 'Enter'?No, that's the catch. Once you start editing text in the DataGridView cell and press Enter (when you want to finish editing), it isn't caught in either KeyPress, KeyDown or any other Key event. Well I suppose it is caught somewhere but I can't find where. Thanks for the answer, anyway Dragan
-
Which event is occuring in DataGridView in edit mode when user pressed 'Enter'?When user is editing a DataGridView cell I can not find a way to capture event when user presses 'Enter' key. In OnCellEndEdit there is no way to see which button was pressed, OnKeyDown and OnKeyPress simply do not detect 'Enter' key, they act as if it wasn't even pressed. If I try to add event handler to editing control by getting the control in EditingControlShowing and then adding event handler KeyPress or KeyDown on editing control, it also acts as if 'Enter' wasn't pressed. I've tried googling on this, but can't find it anywhere. I'd appreciate any help or hint on this. Dragan Matic
-
How to prevent DataGridView from skipping to next row after edit/EnterNo, because I have a problem with editing the cells. After I enter some text in the cell, and after pressing Enter and if there is another row under the current one, the cell under the edited one becomes selected. Setting AllowUserstoAddRows to false will not change that behavior. And if I add event handler to say, CellEndEdit and move it somewhere else (say, to the next cell in the same row), some other event moves the active cell to the next column after that, so I get active cell moved one place right and one place down. I cannot find where that event is occurring.
-
How to prevent DataGridView from skipping to next row after edit/EnterIs there a way to prevent a DataGridView with TextBox fields from skipping to next row after pressing Enter after editing value in Cell? In cell Edit mode it automatically goes to next row after pressing Enter. I've tried overriding OnKeyDown, OnCellEndEdit, OnCellLeave, EditingControlShowing and adding handler to TextBox control, but there seems to be an event occuring after all those events and I can't find where to catch the event where DataGridView finished editing cell and skips to next row. Any Ideas? Tnx in advance Dragan Matic
-
Die COBOL... Die!!Geez man, in my firm we are still developing things in COBOL. These are windows gui programs with COBOL backend, well usually around 15 - 20.000 lines of code, all global variables. Shivers :sigh: The problem is, as usually, the human factor. :sigh: People who have learned COBOL some 30-40 years ago, and have never learned anything besides it, today simply cannon program in anything else. Add that to the fact that in these cases the manager is also a COBOL dinosaur, and you have a COBOL development today... But, sometimes there can be a light in this tunnel... :-) Luckily, I managed to persuade the managers that COBOL for .NET :omg: is simply not the way to go. New development is now done in C# while COBOL experts are maintaining legacy applications. And, BTW, if you have never programmed in COBOL you can not really hate it. After programming in it you start to understand what the word hate means... :mad: BTW, where is that other thread?
-
Prevent DataGridView to move to next row after edit?Yes, the problem is that currentCell is moved after CellEndEdit event. I can reposition current cell back to coordinates I want in CellEndEdit event, but something after that happens in DataGridView that moves currentCell one field down, and I simply can't find out where it is happening.
-
Prevent DataGridView to move to next row after edit?Is there a way to prevent dataGridView to move to the next row after editing the cell? It happens after EndEdit event, so handling EndEdit doesn't help. Tnx in advance Dragan Matic
-
How can vs2005 debugger catch unhandled exceptions in dynamically loaded assemblies?I have a problem how to catch unhandled exceptions in vs2005 in dynamically loaded assemblies, for instance, the following line if not defined in try/catch block will cause the debbugger to catch the unhandled exception, show the appropriate message and position to the problematic line. int i = Convert.ToInt32("asdfas"); On the other hand, if I have an assembly that is loaded at run-time, for instance like this: Assembly a = Assembly.Load(strAssembly); Type ObjectType = a.GetType(strClass); object obj = Activator.CreateInstance(ObjectType); MethodInfo mi = ObjectType.GetMethod("SomeMethod", pars); mi.Invoke(obj, null); and there is an unhandled exception somewhere in the assembly, VS2005 will not catch that exception (even if assembly is compiled as DEBUG and can be debugged into) but instead 'mi.Invoke' will exit with generic exception 'exception has been thrown by the target of the invocation'. Is there a way for VS2005 to catch these exceptions and position to problematic line like it does with non run-time loaded assemblies? Dragan Matic
-
Can VS2005 catch exceptions in external dll-s?If I do something like this: int i = Convert.ToInt32("asdfas"); without the try/catch block and start a program with the above line in VS2005, the IDE will catch the exception, show the appropriate message and position to the problematic line. On the other hand, if I have an assembly that is loaded at run-time, for instance like this: a = Assembly.Load(strAssembly); Type ObjectType = a.GetType(strClass); object obj = Activator.CreateInstance(ObjectType); MethodInfo mi = ObjectType.GetMethod("SomeMethod", pars); mi.Invoke(obj, null); and there is an unhandled exception somewhere in the assembly, VS2005 will not catch that exception (even if assembly is compiled as DEBUG and can be debugged into) but instead 'mi.Invoke' will exit with generic exception 'exception has been thrown by the target of the invocation'. Is there a way for VS2005 to catch these exceptions and position to problematic line like it does with non run-time loaded assemblies? Dragan Matic
-
replacing windows explorer in windows XPThanks a lot, I was trying with "windows xp shell replacement" and some similar combinations and I was getting some not really useful results. Well I'd better start with some "learn to use google" course, first. :sigh:
-
replacing windows explorer in windows XPOn windows 98 there was a feature that you could've changed the line "shell=explorer.exe" in system.ini into something like "shell=c:\myprogramdir\myprogram.exe". That would efectively replace the explorer shell with myprogram.exe. What is the way to do it in windows XP? Tnx in advance Dragan Matic
-
Screen shotsPrint Screen + Paint :-)
-
What font and font size do you use in your IDE?Bitstream Vera Sans Mono - 11 pt. It is very similar to Consolas (actually I think I should say that Consolas is similar to BVSM), but I find it more readable.
-
MSDN subscription would you renew now?Nope. My MSDN subscription ended in december 2005 - just in time to receive VS2005 :-) - what a perfect timing. I might subscribe again in a year or so when (or if) Vista becomes common thing on desktops and Orcas is in beta 2 :-)
-
Learn another language (spoken)Hockey wrote:
Objects have both feminine and masculine terms as well as singular and plural...why is that? For instance the article on German used "The Airplane(s)" as an example: das was used for singular and die was used for plural followed by the word Airplane in german of course... I'm curious...is there a reason why European languages have a different way of describing something as masculine or feminine?
Many languages have grammatical gender. The proto-indo-european language (which is supposedly common ancestor to all european languages) had two genders. During the time some languages have lost grammatical gender and some have kept it. Here you can find a list of languages which have two or more grammatical genders: http://en.wikipedia.org/wiki/Grammatical_gender
-
Visual Studio 2005 SP1It may be stupid question, but how is that checkpoint removed?
-
VS2005 Sp1After 30 minutes of installing (it came to 'analyzing your current configuration' - or something like that) in the background, the window came to the foreground - and not realizing that - and thinking that I am still working in another window I pressed ESC! Installer exited immediately without any confirmation! :sigh: How ingenious!!!! :(( Can't understand how difficult it would have been to put a confirmation dialog on exit. :wtf: Well, here we go again...
-
How many language can you speak?serbian, croatian (as a native language), hungarian (as a second native lang), english (naturally :-), a little bit of german, and currenly learning french. In two years time I plan to start learning spanish. Speaking of language, I still haven't done my french homework and I have a lesson tommorow. :( I'm off to work... :->