|
You just replied to a 5 YEAR OLD post! Doing so is a complete waste of time.
|
|
|
|
|
FOUR forums with the same question?!?!?!
Blog link to be reinstated at a later date.
|
|
|
|
|
|
Good morning folks from germany.
My question is:
How can I show a pre-information like "Application starts.... please wait ...." (after a short startup/load-time) in a box or else to the user shortly after he had done the doubleclick on the application-icon on the desktop, while the main-application is starting in background. Its because the application is very big and takes a longer time to finalize the startup. The application is progammed in C# 2005 and .NET 2.0
Thanks for advance
|
|
|
|
|
What you need is called splash screen. There are several implementations here on codeproject so a simple search should return them
|
|
|
|
|
show Splash screen
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
Below is the code I am using to get the unread emails, checking their subject and processing accordingly. The problem is that I am getting the exception "System.ArgumentException" which says "Cannot find the method on the object instance" on the line where I am trying to find out the number of attachments in a mail. The line is -
iAttachCnt = mailItem.Attachments.Count;
// Here is the complete code
private void WeeklyExpenses_Load(object sender, EventArgs e)
{
Outlook.NameSpace oNs;
Outlook.MAPIFolder oFldr;
int iAttachCnt;
DirectoryInfo di = new DirectoryInfo(System.Environment.CurrentDirectory.ToString() + "\\centralexpenses\\" + DateTime.Now.ToString("yyMMdd") + "\\");
if (!di.Exists)
{
di.Create();
}
string strPath = System.Environment.CurrentDirectory.ToString() + "\\centralexpenses\\" + DateTime.Now.ToString("yyMMdd") + "\\";
try
{
String sClassComp = "IPM.Note";
oOutlook = new Outlook.Application();
oNs = oOutlook.GetNamespace("MAPI");
oFldr = oNs.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
Outlook.Items newMailItems = null;
Outlook.MailItem mailItem = null;
Outlook.Attachments atmt = null;
newMailItems = oFldr.Items.Restrict("[unread] = true");
foreach (object item in newMailItems)
{
if (((Outlook.MailItem)item).MessageClass == sClassComp)
{
mailItem = (Outlook.MailItem)item;
if (mailItem.SenderEmailType == "EX")
{
string emailString = X4UMapi.GetMessageSenderAddress(mailItem.MAPIOBJECT).ToString();
int lastindex = emailString.LastIndexOf("=") + 1;
empEmail = emailString.Substring(emailString.LastIndexOf("=") + 1, ((emailString.Length - 1) - emailString.LastIndexOf("="))) + "@phfi.org";
}
else
{
empEmail = mailItem.SenderEmailAddress.ToString();
}
iAttachCnt = mailItem.Attachments.Count;
if (mailItem.Subject.ToString().ToUpper().Contains("Weekly Expenses") && iAttachCnt != 0)
{
foreach (Outlook.Attachment attachment in mailItem.Attachments)
{
string filename = attachment.FileName.ToLower();
if (filename.EndsWith(".xls"))
{
mailItem.UnRead = false;
filename = strPath + attachment.FileName;
flName = attachment.FileName;
attachment.SaveAsFile(filename);
Marshal.ReleaseComObject(attachment);
openandProcessExpenses(strPath, flName, empEmail);
smMail.sendMail(empName, empEmail, errorDescription);
}
}
}
else
{
if (iAttachCnt == 0)
{
errorDescription = "The Mail Sent By You is Not a Valid Email for Processing The Centrally Incurred Expenses As It Does Not Contain Any Attachments";
}
smMail.sendMail(empName, empEmail, errorDescription);
}
}
}
}
catch (System.Exception ex)
{
}
finally
{
GC.Collect();
oFldr = null;
oNs = null;
oOutlook = null;
}
}
-----Have A Nice Day-----
|
|
|
|
|
Not sure about this but what happens if you cast the mailItem to primary interface (_MailItem[^]):
iAttachCnt = ((_MailItem)mailItem).Attachments.Count;
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hai friends,
Iam creating an application that uses a datagrid with two combobox and two textbox columns.
Iam able to save the info from datagrid to XML file.
But when the time of opening XML file to datagrid it retrieves the datagrid error.
Please help me to remove this error and load XML data in to datagrid...
Thanks in advance
KP
|
|
|
|
|
With the details that you have provided, we wont be able to do anything else other than sharing this[^]link.
*jaans
|
|
|
|
|
|
Hai,
Sorry for delay. went for lunch
Piece of code
private RibbonStyle.RibbonButton rbtnOpen;
private System.Windows.Forms.DataGridView datagrid1;
private System.Windows.Forms.DataGridViewTextBoxColumn txtSlNo;
private System.Windows.Forms.DataGridViewTextBoxColumn txtEntities;
private System.Windows.Forms.DataGridViewComboBoxColumn cmbType;
private System.Windows.Forms.DataGridViewComboBoxColumn cmbSubType;
txtSlno : Auto generation
txtEntity : user data
cmbType : Combobox data(loaded programmatically)
cmbSubType : Combobox data(loaded programmatically)
I want to load the data from the XML file(explained below) to the datagrid while openning XML file.
<NewDataSet><br />
<EntityTable><br />
<SlNo>1</SlNo><br />
<Entity>X</Entity><br />
<Type>Data</Type><br />
<SubType>EIF</SubType><br />
</EntityTable><br />
<EntityTable><br />
<SlNo>2</SlNo><br />
<Entity>Y</Entity><br />
<Type>Data</Type><br />
<SubType>ELF</SubType><br />
</EntityTable><br />
<EntityTable><br />
<SlNo>3</SlNo><br />
<Entity>Z</Entity><br />
<Type>Transaction</Type><br />
<SubType>EI</SubType><br />
</EntityTable><br />
</NewDataSet>
Regards,
KP
|
|
|
|
|
i want to move the form at run time by holding it from any area of the from . not only by holding it from the title bar , any idea?
|
|
|
|
|
You will need to subscribe to mousedown, mousemove and mouseup events of the form. Then adjust location form's position accordingly.
|
|
|
|
|
The code below should help you
private bool IsPickedUp = false;
private void pnlTop_MouseDown(object sender, MouseEventArgs e)
{
try
{
if (e.Button == MouseButtons.Left)
{
this.xPos = e.X;
this.yPos = e.Y;
this.IsPickedUp = true;
}
}
catch (Exception ex)
{
}
}
private void pnlTop_MouseMove(object sender, MouseEventArgs e)
{
try
{
Screen[] screens = Screen.AllScreens;
int width = screens[0].WorkingArea.Width;
int height = screens[0].WorkingArea.Height;
if (this.IsPickedUp)
{
Point temp = new Point(0, 0);
if (((this.Location.X + (e.X - this.xPos)) > 0) && (this.Location.X < (width - this.Width)))
{
temp.X = this.Location.X + (e.X - this.xPos);
}
else
{
if (e.X > this.xPos)
{
temp.X = (width - this.Width);
}
else if ((this.Location.X + (e.X - this.xPos)) > 0)
{
temp.X = this.Location.X + (e.X - this.xPos);
}
}
if ((this.Location.Y + (e.Y - this.yPos) > 0) && (this.Location.Y + (e.Y - this.yPos) < (height - this.Height)))
{
temp.Y = this.Location.Y + (e.Y - this.yPos);
}
else
{
if (e.Y > this.yPos)
{
temp.Y = (height - this.Height);
}
else if ((this.Location.Y + (e.Y - this.yPos)) > 0)
{
temp.Y = this.Location.Y + (e.Y - this.yPos);
}
}
this.Location = temp;
}
}
catch (Exception ex)
{
}
}
private void pnlTop_MouseUp(object sender, MouseEventArgs e)
{
try
{
if (e.Button == MouseButtons.Left)
{
this.IsPickedUp = false;
}
}
catch (Exception ex)
{
}
}
Please note that i am using panel here. You can use any control and register above events from them.
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
thanx, but could you please explaine me what is meant by all screens property, in the documentation it says ,takes all displays in the screen..
|
|
|
|
|
That's a non-standard interface. I recommend that you do not do it.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello all,
Am planning to use Logging and Instrumentation Application Block to instrument our product. Any bad experiences?
Thanks.
|
|
|
|
|
They are quite good. Use them freely
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
Hi everybody,Can any one Help me how to create Thumbnails using C#.net. I am using VS2005.I have searched but
|
|
|
|
|
Look at the System.Drawing.Image.GetThumbnailImage method.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
You can use GetThumbnailImage() to get a thumbnail. Most of the time this will give poor quality images. GetThumbnailImage() returns the embedded thumbnail from the image and re size to the specified size.
You can get good quality thumbnails by using Bitmap and Graphics classes. Try the following steps
1 - Create a Bitmap instance with the required width and height.
2 - Load the original image to a Graphics instance (Graphics.FromImage()).
3 - Use Graphics.DrawImage() to draw the image to bitmap.
bitmap instance will have the thumbnail image.
|
|
|
|
|
N a v a n e e t h wrote: 2 - Load the original image to a Graphics instance (Graphics.FromImage()).
That should rather be:
2 - Get a Graphics instance for drawing on the newly created Bitmap (Graphics.FromImage).
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: 2 - Get a Graphics instance for drawing on the newly created Bitmap (Graphics.FromImage).
Yeah. That is more clear.
|
|
|
|
|
Hi guys, msndn says that "The WebBrowser control cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code. " http://msdn.microsoft.com/en-us/library/8skskf63.aspx[^]">
Does it mean that I cannot instiante webbrowser control as shown below.
public partial class lralHTMLEditor : UserControl
{
public lralHTMLEditor()
{
WebBrowser webbrowser1 = new WebBrowser();
}
}
|
|
|
|