|
I have written the following code. It displays the notify icon in the system tray. But when I right click on the icon in the system it's not showing any menu there. I can't understand why this is not showing the menu. Can someone help me to show this?
ContextMenuStrip cms = new ContextMenuStrip();
ToolStripMenuItem mI1 = new ToolStripMenuItem();
mI1.Text = "Exit";
mI1.Click += new EventHandler(Click_Handler);
cms.Items.Add(mI1);
notifyIcon1.ContextMenuStrip = cms;
notifyIcon1.Visible = true;
notifyIcon1.Visible = true;
notifyIcon1.BalloonTipTitle = "My service";
notifyIcon1.Icon = new Icon("utility1.Ico");
notifyIcon1.BalloonTipText = "Started Successfully";
notifyIcon1.Text = "Service is running";
notifyIcon1.ShowBalloonTip(500);
|
|
|
|
|
do you have a message pump?
in a WinForm, when you show a form (with Show, ShowDialog or Application.Run) you get a message pump which deals with Windows messages and brings it all to life. A console app doesn't have a default message pump. One way to get one is by showing an invisible form (e.g. outside the desktop area).
|
|
|
|
|
I don't have any idea about message pump.
My console application is working as a server (in client server socket programming). I wrote the code for notify icon in the main function.
Can I have links or example code that will help me to display the context menu in the notify icon of my console application??
|
|
|
|
|
I need answer please help meee...
|
|
|
|
|
I am using thecode below to generate the reports but I want to know how to modify it to export to PDF file directly without a need of the report viewer control?
private void generate_invoices()
{
this.Cursor = Cursors.WaitCursor;
sql_connection = new SqlConnection(public_var.sql_server_connection);
try
{
sql_connection.Open();
sql_command = new SqlCommand("sp_get_account_book_by_book_guid", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
sql_command.Parameters.Add("@book_guid", SqlDbType.UniqueIdentifier).Value = book_guid;
DataSet data_set = new dsReports();
reportTICS.Reset();
sql_reader = sql_command.ExecuteReader();
data_set.Tables[0].Load(sql_reader);
reportTICS.LocalReport.ReportEmbeddedResource = "dsReports_sp_get_account_book_by_book_guid";
reportTICS.LocalReport.ReportPath = @"C:\Users\Jassim\Documents\Visual Studio 2008\Projects\Takhlees\Takhlees\envoice.rdlc";
ReportDataSource rds = new ReportDataSource();
rds.Name = "dsReports_sp_get_account_book_by_book_guid";
rds.Value = data_set.Tables[0];
reportTICS.LocalReport.DataSources.Add(rds);
ReportDataSource rds2 = new ReportDataSource();
rds2.Name = "dsReports_sp_get_account_book_by_account_number";
rds2.Value = data_set.Tables[0];
reportTICS.LocalReport.DataSources.Add(rds2);
reportTICS.LocalReport.Refresh();
reportTICS.RefreshReport();
if (chkSaveInvoice.Checked == true)
{
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string filenameExtension;
byte[] bytes = reportTICS.LocalReport.Render("PDF", null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings);
string file_path = "c:\\temp\\envoice\\" + DateTime.Now.ToString("dd MMM yyyy");
System.IO.Directory.CreateDirectory(file_path);
string file_namr = file_path + "\\" + System.Guid.NewGuid() + ".pdf";
using (System.IO.FileStream fs = new System.IO.FileStream(file_namr, System.IO.FileMode.Create))
{
fs.Write(bytes, 0, bytes.Length);
}
Process.Start(file_path);
}
progressInvoice.Minimum = 0;
progressInvoice.Maximum = data_set.Tables[0].Rows.Count;
}
catch (Exception exp)
{
event_log.create_event("Problem preparing or viewing daily report." + Environment.NewLine + Environment.NewLine + exp.Message + Environment.NewLine + Environment.NewLine + exp.Data + Environment.NewLine + Environment.NewLine + exp.StackTrace + Environment.NewLine + Environment.NewLine + exp.InnerException, EventLogEntryType.Error, 9999);
MessageBox.Show("Problem preparing or viewing daily report!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(exp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
this.Close();
}
finally
{
if (sql_reader != null) sql_reader.Close();
if (sql_connection != null)
{
if (sql_connection.State == ConnectionState.Open)
sql_connection.Close();
}
}
this.Cursor = Cursors.Default;
}
|
|
|
|
|
I have nserted a table in my report which has header, details and footer but the footer is printing directly below the last details row.
how can I print the footer at the bottom of the page? because I am design a n invoice an dI want the footer to have the sum and printed at the bottom even if there is only one details row..
|
|
|
|
|
can anybody help pleazzzzzzzzzzzzzzzzzzzze....
|
|
|
|
|
What is XOR operator precedence following list?
Precedence
! NOT 1
& AND 2
| OR 3
^ XOR
|
|
|
|
|
|
Order of precedence
! NOT
& AND
^ XOR
| OR
MSDN provides answers for such questions.
There's nothing left in my right brain and nothing right in my left brain. |
|
|
|
|
|
Hi all...............
I need a link to download a SharpPcap new version SharpPcap-2.2.0rc1.src sourcce code, i need to use some of its functions at my project................
Regards...
|
|
|
|
|
|
Richard MacCutchan - Excellent
I vote for your
|
|
|
|
|
I learnt it from another person here on CP ... keep it going.
|
|
|
|
|
Thank u for interest, but don' find the source code at any one of the results..................
Can u help me to find that, i really need it at my project, i'm out of date since many days........................................
|
|
|
|
|
What exactly can you not find?! It's bleeding obviously searchable and the download is available on this page[^].
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
How on earth some of these people manage to make a living as developers is totally beyond me!
|
|
|
|
|
|
Hey buddys I was making a POS Software ... and it realy huge size ... & wen i made some changes and want to run it ... it takes lot time ... So I was hoping if there is a way to just compile the modified line of code and then to run it ... I thought it will not compile the hole code again ? is that possible?
|
|
|
|
|
Are you looking for Snippet compiler[^]?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
I dont know what it is ... and I followed the link but there is just a picture of some lines of code ... can u tell me briefly please?
|
|
|
|
|
Below that image, there is are download links based on the framework version. Now, instead of compiling you entire project, you can place the lines of code inside that main method in Snippet compiler and run as you would do in the VS.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
CoderForEver wrote: I was making a POS Software ... and it realy huge size ..
A single executable? How large is "huge"? Are we talking more than 10 Mb?
CoderForEver wrote: So I was hoping if there is a way to just compile the modified line of code and then to run it ..
Sounds like you want to divide your project into different subprojects. Try and move some of your code to an assembly that can be loaded during runtime. That way you only need to (re)compile the assembly that you're working on, as opposed to the entire codebase.
I are Troll
|
|
|
|
|
the Executable is not huge ... but there are a lot of forms .... in which they contain a lot of buttons and pictures to make our pos system high quality graphics ... so when I i change some line of code ... it debugs the whole program ... but I I want to compile that line of code only and to run it .... I hope u got what i meant...
Thank you for your kind help
|
|
|
|
|
Try to move a form to a DLL, and load it from that assembly. That way you'll only have to compile the assemblies that are actually modified. As an example, add a new class-library to the project. Next, create a form in that class library. Lastly, add a reference from your main-project to the new classlibrary - you'll see that you can access your form and display it within the original project. If you make any changes in the form, remember to recompile the classlibrary too.
Resources like images can also be loaded at runtime
I are Troll
|
|
|
|