|
|
Hello,
I need to remove the taskbar icon for my application and run it from System tray only. The menu is a context menu on the system tray icon and I want it to have no icon in the taskbar (no long bar with the application name on it).
I have figured out how to have the system tray icon, but how do I make it so that the app does not have a taskbar icon even when running normally or maximized (not just when its minimized ).
Thanks
|
|
|
|
|
Set the Form.ShowInTaskbar property to false .
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanks for a fast and good answer
|
|
|
|
|
Hi all,
I have just read the following article: http://www.codeproject.com/csharp/printhml.asp[^]
Here it describes how to print a html document and it works BUT it works in the same way as the following piece of code:
Process myProcess = new Process();<br />
myProcess.StartInfo.FileName = TemplatePath + "\\Invoice.HTML";<br />
myProcess.StartInfo.Verb = "Print";<br />
myProcess.StartInfo.CreateNoWindow = true;<br />
myProcess.StartInfo.UseShellExecute = true;<br />
myProcess.Start();
Is there someone who used the code from the article and would any one know how to specify a printer as to not make the "select printer" screen come up? Both of these two ways bring up the screen where the user needs to select the printer... I've been stuck with this one a while now.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hello,
I don't know if this solution also works for printing of files.
I used it for directprint a bitmap.
PrintDocument pd = new PrintDocument();
pd.PrinterSettings.PrinterName = "youreprinter";
PageSetupDialog psd = new PageSetupDialog();
psd.Document = pd;
psd.PageSettings.Landscape = true;
pd.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(PrintCurrentPage);
pd.Print();
private void PrintCurrentPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
}
Again, I don't know if it works for you but maybe it helps.
All the best,
Martin
|
|
|
|
|
Okay thanks, i'll give it a try.
Thank you for your time...
Enjou the rest of your day.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
thank you but i can't seem to find a way to specify a file and not a graphic. But thank you any ways... I guess it's back to the drawing board for me......
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
After a few months of using OOP and C#, there is one thing I can't get my head round:
* I've got the main form (Form1).
* Form1 contains two user controls (UserControl1 and UserControl2), both of which have some code associated with them.
* When UserControl1 is operated, I want (under certain circumstances) to refresh UserControl2.
UserControl1 does not know of the existence of UserControl2, so the call has to somehow go through Form1. I could solve this by having a static method in Form1 that will refresh UserControl2, but that wouldn't be very OOP.
What's the correct way of doing this? Am I missing the point somewhere?
Thanks for your help.
|
|
|
|
|
Raise an event in UC1, handle that event in Form, and update UC2.
|
|
|
|
|
Or use Parent.Refresh(), not very elegant since it'll refresh all child controls in your form, but it works.
|
|
|
|
|
Thanks for both your answers.
It works now.
|
|
|
|
|
You can also create a handler object that handles updating the user controls on the form.
|
|
|
|
|
How to implement shortkut keys for menus and buttons
My small attempt...
|
|
|
|
|
Try using text property of button like &Press. Putting & before any character will make it shortcut ley. Here P will become shortcut key.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
When setting the Name property, just provide an ampersand ( & ) to indicate the shortcut key that must be pressed to activate this control.
btnClick.Name = "&Click";
|
|
|
|
|
Hi Senthil,
Name property will not work in this case. It should be the Text property. Name will be used as identifier and will not be displayed on button while Text is actually displayed on button. Try to change the name to "&Click". It will show invalid property dialog box. With Text property it will work smooth.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Yes, you're right. I must check the documentation before posting replies
|
|
|
|
|
I am using interop.excel dll to access my Excel 2000 thru ASP.NET Script.. The Problem is that I am not able to kill the instance of Excel with that.
Can somebody plz let me know the way to do the same !!!
|
|
|
|
|
Hi Dear Respected programmers
Kindly help me, I created a little chat server programe. whenever client attemps to send data so errer is arrising from Server side.
Error is : "Cross-thread operation not valid: Control 'textBox2' accessed from a thread other than the thread it was created on."
above mentioned problem is happinig both side. Server side and Client side.
kindly read my following code. and please tell me my mistake.
thank you in advance
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net.Sockets;
using System.Threading;
using System.IO;
namespace Server
{
public partial class Form1 : Form
{
private Socket connection;
private Thread readThread;
private NetworkStream SocketStream;
private BinaryWriter writer;
private BinaryReader reader;
private int intCounter = 0;
private string strTheReplyer = "";
public Form1()
{
InitializeComponent();
}
public void RunServer()
{
try
{
TcpListener listener = new TcpListener(5252);
listener.Start();
while (true)
{
connection = listener.AcceptSocket();
SocketStream = new NetworkStream(connection);
writer = new BinaryWriter(SocketStream);
reader = new BinaryReader(SocketStream);
textBox2.Text += "\r\nConnection " + intCounter + " received.";
writer.Write("Server=> ok");
//string strTheReplyer = "";
do
{
try
{
strTheReplyer = reader.ReadString();
//message = strTheReplyer.Trim();
//MessageBox.Show(strTheReplyer, "Server");
textBox2.Text = strTheReplyer;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.Source);
}
}
while (strTheReplyer.ToUpper().Trim() != "CLIENT=> QUIT" && connection.Connected);
textBox2.Text += "\r\nClient gone.";
writer.Close();
reader.Close();
SocketStream.Close();
connection.Close();
++intCounter;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.Source);
//textBox2.Text += "\r\n" + Convert.ToString(ex.Source) + " " + Convert.ToString(ex.Message);
}
}
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
try
{
if (e.KeyCode == Keys.Enter && connection != null)
{
writer.Write("Server=> " + textBox1.Text.Trim());
textBox2.Text += "\r\n" + textBox1.Text.Trim();
if (textBox1.Text.ToUpper().Trim() == "QUIT") connection.Close();
}
else
{
//textBox2.Text += "\r\n" + strTheReplyer.Trim();
}
}
catch (Exception ex)
{
textBox2.Text += "\r\n" + ex.Source + ": " + ex.Message;
}
}
private void Form1_Load(object sender, EventArgs e)
{
textBox2.Text += "\r\nWaiting for incoming client ...";
readThread = new Thread(new ThreadStart(RunServer));
readThread.Start();
//textBox2.Text += "\r\n" + message.Trim();
}
}
}
|
|
|
|
|
You can use an attribute to turn off this error. Or, you can use a worker thread which sends messages back to the main thread, whch can then update the UI.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Create a new thread while making any calls to server. Let that thread handle it. If u r using .NET 2.0, use form.InvokeRequired().
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
I am student of final year engineering student. I selected “SMS Website” as my project topic. In this I have to send Bulk SMS through website and provide other kind of services related to SMS.
Please tell me which steps I should follow.
Please send me some material or any kind of source code related to it.
I need your help.
Thank you!!!
Contact Me: ashish.0619@gmail.com
|
|
|
|
|
hi,
How to use that assembly update Version????? Pls tel me.......
Thanking you
somasundaram
|
|
|
|
|
hi,
Does any body knows how to create a new user in the active directory using the C# language.
Best regrads,
Jamil Abou Khalil
|
|
|
|