|
Yoyosch wrote:
how am I supposed to exit from the place 'XXX' so that I would 'land' outside (after) the most internal ('for') loop?
Use goto
for(...)
{
foreach(...)
{
if (...)
{
while(...)
{
goto Gotcha;
}
}
}
}
Gotcha:
Console.WriteLine("Gotcha");
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
this is surely fastest way but is recognazed as extremaly nasty... there is no other way (line using several break;`s ?)
|
|
|
|
|
|
[code]
bool error = false;
for(...)
{
foreach(...)
{
if (...)
{
while(...)
{
//-> XXX <-
error = true;
break;
}
}
if (error)
break;
}
if (error)
break;
}
[/code]
|
|
|
|
|
Hi, I am using the system.drawing.printing.Printdocument in a small windows application to print labels. I am wondering if there is a way to prevent the printing progress dialog box from displaying once the user has initiated the print function?
|
|
|
|
|
Yes. Put this before your Print call:
myPrintDocument.PrintController = new StanderdPrintController(); I hope this helps!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
i have a problem with Thinstall http://thinstall.com/help/?linking_netframework.htm[^]
if get this error if i create new projekt with my .exe file! i work with Automatic .NET EXE detection during new project Wizard....
-> Failed to open C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\1031\cscompui.dll
any idea what can be the problem!?
cu
|
|
|
|
|
surfman19 wrote:
any idea what can be the problem!?
The folder is wrong - it's 1033, at least on my PC it is. The rest of that path works fine on my computer.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi,
i dont understand...Thinstall always want to have this file...i dont understand that!!???? why?
cu
|
|
|
|
|
hi i have a .exe file which load a xml file....but the xml file mustn't be loaded into the exe!? the exe dont work with the xml on the computer where no framework is installed;-(
cu
|
|
|
|
|
First of all, any solution for creating an exe without the framework is a hack. Second, this product is obviously crap, because it's looking for a dll it needs in the wrong place. I'd give it up.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
surfman19 wrote:
did you already use thinstall?
No chance in hell. I wouldn't trust any framework like that, like I said, it's a hack.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi, I used the tutor from microsoft to get messages from my IR Control (link). The code works fine, but when the window loses focus, it doesn't work anymore.
I need this code to work also when the program doesn't have focus (global hook?).
Thanks in advance.
|
|
|
|
|
From the little that I've seen about this, the remote works by using keyboard emulation. About half of the remote's keys are sent to the application using WM_INPUT and WM_KEYDOWN messages. This makes it easy to use, but when the focus changes, the "keystrokes" are now going to another application.
This presents a problem. Since the message from the remote are exactly like normal keyboard messages, there's no way to tell them apart. You COULD put together a low level keyboard hook, but there's no way to tell if the keystrokes you're seeing are coming from the real keyboard or from the remote.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks, I'll go find some stuff on keyboard hooks then.
|
|
|
|
|
I use following code snip to validate @ sign, but it works with US keyboard only.
switch(e.KeyData)
{
case Keys.D2 | Keys.Shift: // @
It seems that System.Windows.Forms.Keys enumeration did not specified @ sign. How can I know I receive @ sign in KeyEventArgs?
TIA,
Frank
|
|
|
|
|
Have you checked the integer value of the keycode? My guess is that value will be unique to the @ symbol.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
The value is 50, which is the ASCII value of 2. The KeyData is Keys.D2 | Keys.Shift. Actually, the ASCII value of @ is 64. Any idea? TIA.
|
|
|
|
|
Here is a quote from one of Nish's articles using MFC
Using PreTranslateMessage to handle dialog keystrokes
Very often you hear questions from novice programmers asking
how they can trap keystrokes in a dialog based application.
Presumably they tried to handle WM_KEYDOWN/WM_KEYUP unsuccessfully.
The whole problem is that in a dialog based application the focus
is always on one of the child controls and not on the main dialog
window. So what do you need to do? You need to override
PreTranslateMessage.
How do you accomplish this using C#?
|
|
|
|
|
There is a SystemKey event. Also, a dialog in C# has a property called 'key preview', which I believe means the dialog gets the keyboard message before the control does.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
In your form code, override ProcessCmdKey method.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
follow this article through should answer your question.
http://www.codeproject.com/csharp/globalhook.asp
|
|
|
|
|
I don't know if anyone else has had this problem with the AxWebBrowser. I have a AxWebBrowser on a form and it works great when I bring up the form for the first time. When I open the form for the second time however the AxWebBrowser control seems to become unattached from the form. It still shows up but it is just floating by itself.
Do I need to use the dispose method for the AxWebBrowser when I close the form? If so how do I create the AxWebBrowser during runtime? I tried to do this but I'm doing something wrong because the Browser doesn't show up. I tried this code in the form's load event.
AxSHDocVw.AxWebBrowser WebBrowser = new AxSHDocVw.AxWebBrowser();<br />
WebBrowser.Location = new System.Drawing.Point(8, 8);<br />
WebBrowser.Size = new System.Drawing.Size(100,100);
|
|
|
|