|
Create a MDI Form and load your forms and child forms.
Here you can create a navigator to control them
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
I had written service which will fire for every 3 seconds.Actually I had written a service which fire when an user open a word document and click print button on it.For this Iam using WMI from that Iam checking jobs for every 3 sec.
Now I want to make my service work only when a print button(i.e., normal print option from notepad,wordpad,document....like..)is fired.
I think i have to watch the events.....how to do that i have no idea..
Kindly help me and guide in proper way..
Thanks
|
|
|
|
|
Please don't cross post.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
After adding a toolbar to my application, I decided to change the appearance of my toolbar buttons to the more modern "flat" style by setting the toolbar's "Appearance" property to "Flat". But when you do that, you also get another feature which is a "transparent toolbar". The unwanted transparency causes problems with my application. For example, a portion of the bitmap which was previously located underneath the toolbar is seen behind the buttons and moving the window causes the background to become garbled.
So my question(s) are:
- Is there any way to have flat style toolbar buttons without being forced to use a transparent toolbar?
- If the answer to the previous is "no", then is there a way I can force the toolbar background to always be the "control color"?
Thanks -- Greg
|
|
|
|
|
If the windows form designer just changes your toolbar's BackColor to Transparent, you can change it again manually in the properties window. I this does not work, you can derive a class from Toolbar and override OnPaintBackground.
|
|
|
|
|
Thanks, but:
#1 - There is no BackColor property for the toolBar.
#2 - Surprisingly, an override for OnPaintBackground is *never* called. That surprised me so I tried overriding OnPaint - same thing never gets called. However, an override of OnButtonClick *does* get called.
public class FlatToolBar : System.Windows.Forms.ToolBar
{
public FlatToolBar()
{
//
// TODO: Add constructor logic here
//
}
protected override void OnPaintBackground(PaintEventArgs pevent)
{
base.OnPaintBackground (pevent);
Graphics gfx = pevent.Graphics;
Rectangle rect = new Rectangle (0, 0, this.Width, this.Height);
Brush brush = new SolidBrush(Color.FromArgb(0, 255, 0));
gfx.FillRectangle(brush, rect);
brush.Dispose();
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
}
protected override void OnButtonClick(ToolBarButtonClickEventArgs e)
{
base.OnButtonClick (e);
}
}
}
|
|
|
|
|
This is weird indeed. Just tried it out, and found that you're right. Except that the toolbar DOES have a BackColor property, only it's hidden from the properties window and from intellisense. You can use it in code though, but it has no effect (no wonder when there is no PaintBackground event anyway).
No more ideas, I'm afraid. If you're not forced to use .Net 1.1 you may want to try the .Net 2.0 ToolStrip control which is more flexible.
|
|
|
|
|
One more idea for a workaraound: put a panel with BackColor=Control on the form where the toolbar should be, and the toolbar inside the panel with Dock=Fill.
|
|
|
|
|
Yes, I noticed that there is a BackColor property available when overriding ToolBar and setting that seemed to have no effect. I also thought about the background panel idea but haven't tried it.
I'm using VS 2003 and think that may be part of the problem. I have an MSDN subscription so I plan on upgrading to VS 2008. As you mentioned, I see there is a ToolStrip control and I'm hoping that allows me to solve this problem (it seems like it was a bad design to couple the "flat icon" behavior with the "transparent toolbar" behavior so perhaps the ToolStrip control is better about that.)
Also, upgrading from 2003 has some additional benefits such as the standard image lists.
Thanks for the advice and thanks for trying it yourself,
-- Greg
|
|
|
|
|
Yes, toolstrips will definitely solve your problem. Not only do ToolStrips provide 3 or 4 different renderers that you can choose, you can also create your own renderers for your ToolStrips/Menustrips/StatusStrips/etc. Example: Custom ToolStrip Renderers[^]
Greg Schmidt wrote: Also, upgrading from 2003 has some additional benefits such as the standard image lists.
Of all the features that VS2008 will bring, this is your only concern
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
I'm working on developing a specific application and that was one of the "brick walls" I had encountered.
Another problem I encountered was the inability to unload an unmanaged DLL (I really do have good reason to do this). I worked around the problem in my application in a less than optimal way and I doubt VS 2008 will solve that problem.
But for me the important features are the ones that are relevant to the application at hand.
Regards,
-- Greg
|
|
|
|
|
Hello,
I want to change the color of a full line of a richtextbox (not only some words, the full line including the space in the right after a line-brake). After searching the articles here I found this:
http://www.codeproject.com/KB/cs/shadyrichtext.aspx[^]
It claims to do wat i want, but under my winxp system, it doesn't work, it highlights doesn't highlight the space after a line-brake.
Has anyone another suggestion how to accomplish this?
Greetings,
Mathias
|
|
|
|
|
Has no one any idea how to accommplish this?
Greetings,
Mathias
|
|
|
|
|
I could find topic on applying skins in applications developed in .Net Framework 3.0 and higher using the WPF. But i need to apply it in .Net Framework 2.0 using C#. Can anyone give me hint or some sort of sample code on how to apply skin.
Ur help will be really appreciated.
Thanx in advance.
Sudyp
|
|
|
|
|
You can only apply skins relative to skins already installed on the computer, you can set them through the UxTheme WinAPI. As far as creating your own custom skins and applying them, it gets a bit more difficult.
A few options:
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Mr. Thomas,
First of all thank you for the quick reply. I will definitely go though ur articles. I am hopeful that they are going to of great help for me in trying to skin desktop application.
Regards sudyp
Sudyp
|
|
|
|
|
Dear friends,
I have a problem in using windows services. My problem is that i hava an application which is automatically running on server. And i want to make a windows service that monitor this application for example if this process is not running send a mail to selective users or if not responding then also send. Could anyone help me in this matter.
please tell me how to use the entry written using eventLog.WriteEntry. Please explain fully(using code also)
Regards,
Ashok Kumar
ashokruhela@gmail.com
|
|
|
|
|
Ashok Ruhela wrote: i hava an application which is automatically running on server. And i want to make a windows service that monitor this application for example if this process is not running
Why not just configure the Service to Restart if it stops?
led mike
|
|
|
|
|
This should get you started. Get the list of running processes, from the list figure out if your app is running, if not fire an email to whom ever you want.
To get list of running processes
using System.Diagnostics;
Process[] runningProcessList = Process.GetProcesses();
foreach(Process process in runningProcessList ){
Console.WriteLine("Process: {0} ID: {1}", process .ProcessName, process.Id);
}
to send an email see this
Yusuf
|
|
|
|
|
Hi,
I have developed a custom control with 4 link labels and 2 labels.
i have been able to write delegates and events for this control.
i have written a eventtype event to navigate to the correct link label clicked.
But my problem is that whenever i click the link label it should set the pagenum to the required number.I am not able to figure out as to how or where i should call the eventhandler for the pagenum to be set correctly. Can anybody give me an idea as to how this can be done.
|
|
|
|
|
Hello all,
I am trying to find ways to implement the following:
1. Be able to select(left click & drag) text from IE or other browsers / apps and then drag it into a icon docked on the taskbar.
2.The application should take that text as input and do something else with it.
Is there a way to accomplish this in XP & vista world? How do I go about programming this?
Thanks in advance
Venkat
|
|
|
|
|
You would have to create an extension of the program itself through a plugin (good luck in .NET), or create a WinAPI listener that will interact with generic applications and the program you specify (good luck even more in .NET). The best way would be through C++, but theoretically it is still possible in .NET.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Thomas Stockwell wrote: good luck even more in .NET
Yep. I second that. Can be done, but is a real tall order.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Thanks a lot for your valuable insight. Can you tell me any good resources ( tutorials or books ) that can get me started into developing a plugin whether in C++ or .NET. Or even for a WinAPI listener. Thanks again.
Venkat
|
|
|
|
|
I have never explored too much into what you are asking, but I have stumbled upon some articles in Google and the CodeProject. I would not suggest creating an extension of particular programs since it sounds like you want a generic maneuver that will work throughout the OS. So this leads to WinAPI, keywords to search for: WinAPI, listeners, drag and drop, tutorials, OS integration, microsoft. Good luck, but unfortunately this is about all I can help you with.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|