|
Greetings,
I am writing a toolbar application that I want to dock to the top of the Windows taskbar. I want the form to take up the width of the screen, regardless of resolution. I also want the form to "cut out" the available space for maximized windows. That is, when apps are maximized they stop at the top of my form/toolbar instead of the top of the Windows taskbar (and don't go "underneath" my toolbar).
Any tips on how to accomplish this?
|
|
|
|
|
They are a shell feature called AppBars. Have you tried searching here in CP?
On a quick search, I found this article that looks very good:
http://www.codeproject.com/csharp/csdoesshell3.asp[^]
-- 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
|
|
|
|
|
Terrific, thanks. I had never heard of "appbars" before. I was searching on "Form.DesktopLocation" and "Form.DesktopBounds" and "Form.Size" and "dockable".
A lot of this is knowing the right word to key in...
|
|
|
|
|
Great! I'm glad I could help!
-- 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
|
|
|
|
|
//Here's some code to draw a line in a Rectangle when a Form1_Paint Event
fires w/ "g.DrawLine(....."
**Problem: If I enter new coordinates into the TextBoxes the old line will not disappear, and I just have line after line drawn on Rect....
What's the fix? Thanks....
//Code to fire on Button Event
private void complexA_OK_Click(object sender, System.EventArgs e)
{
Graphics g = this.CreateGraphics();
Pen cmplxAPen = new Pen(Color.Crimson);
//
try
{
double valAReal;
double valAComplex;
valAReal = Convert.ToDouble(this.textComplexAReal.Text);
valAComplex = Convert.ToDouble(this.textComplexAComplex.Text);
DrawComplexNumber(g, valAReal, valAComplex);
}
catch
{
MessageBox.Show("Invalid Complex A Number", "Error!");
}
}
|
|
|
|
|
You're getting a Graphics object, presemably from the form, but you never .Clear() the canvas before you paint the new line.
You really should be doing the majority, if not ALL, of your drawing in the form's Paint event. You can see why if you just enter one set of numbers into your app, then drag your window so that nearly the entire window is off the bottom of the screen, then drag it back up. Your form's blank again, isn't it? You have to repaint it whenever Windows throws a WM_PAINT message your way.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Suppose we have that part of code:
for(...)
{
foreach(...)
{
if (...)
{
while(...)
{
<big>-> XXX <-</big>
}
}
}
}
how am I supposed to exit from the place 'XXX' so that I would 'land' outside (after) the most internal ('for') loop?
|
|
|
|
|
One way would be to turn that code into it's own subroutine and use return; to break the process and close the subroutine
|
|
|
|
|
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
|
|
|
|