|
Norman-Timo wrote:
How can I get in the source at the top for example the 10th integer of the array?
It is reflecting against what was just loaded into memory, there will be no value in the 10th position of the array.
- Nick Parker My Blog | My Articles
|
|
|
|
|
|
Hi,
I have an app which consists of a Main Window and 10 or so client windows. However, I need the app to work like an SDI in that only one window is visible at a time and that window should be maximized.
If I set all my child windows to have WindowState.Maximized this kind of works, but after switching windows 4 or 5 times, I end up with all the windows showing but not maximized.
I have tried various things including overriding OnActivated, OnResizing, OnSizeChanged and changing the windowstate and window size but none seem to work.
Where should I be looking? Is this controlled by the child forms or the MDI Parent?
Thanks for any help
Cheers
James
|
|
|
|
|
My client had a app running in his system. I have to know the
physical path of the file.
|
|
|
|
|
Do you only know the file name itself, no path information is known at all? You could write a simple recursive method to find all files from the root. More information would be helpful.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Application.ExecutablePath is what you looking for?
"Creating tomorrow's legacy systems today.....
.... One CRISIS at a time!" -- Unknown
"If you build it....
.....BUGS will come!" -JB
this.Dispose();
"A Bug is a piece of <sup> code </sup> that knows whatz its purpose"
|
|
|
|
|
Hi,
Iam looking for any code/sample for implementing trace in
.NET remoting so that the client and server log information to the one location.
Any help will be greatly appreciated.
Thanks in advance
saleem
|
|
|
|
|
Assuming the remoting client and server have access to the same resources for logging isn't a safe assumption. Instead, write a logging interface into the server, one that the server can use locally and one that the client can make remote calls to. The backend could be anything you like: database, log text file, XML, whatever (using a provider pattern to provide the backend would be a good idea to be able to switch the backend provider easily).
Search CodeProject for other ideas.
If you want automated tracing of all messages sent back and forth, see the ProxyAttribute class documentation in the .NET Framework SDK. This includes an example of how to use this. While this would only work on the client, all messages to and from both the client and server would pass through your RealProxy -derivative and you could log those to a source (either a source local to the client, or again make remote calls on the server - just be sure not to log those logging calls or else you'll wind up in an infinite loop or messaging).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hi there,
I have a panel control which contain more than 10 label controls. these label controls are added dynamically by user.
In this application user can slit a control into not less than 10 different shares.And adding it to panel control list.
(don't worry about this. If a user select a control to split into 5 or 10. i am simply creating 5 or 10 controls which have the size 5/10 or 10/10 of the control which took to split.)
My question is something different. After spliting if i click on that different split then it will maintaine their state and will be there on panel . Otherwise say if i am doing someother work just after spliting the control it will vanish from that panel.
Do you have any idea ?
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Define what you mean by "split".
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i use winxp,& i'd like to craet a program in c# to send e-mail to hotmail...
please help me.
if someone want to help me he should know that i don't know anything about sending e-mails.
thanx alot.
|
|
|
|
|
hi there,
if you want to send emails to any mailserver then you have to use a namespace called
System.Web.Mail.
After that you can use SmtpMail Class which contain a static method called SmtpMail.Send().
You can overload this method in two different ways.
1. You can directly pass required parameter for sending mails in that Smtp.Send() method.
Eg.
string from="Yourname@hotmail.com",to="qqq@hotmail.com",subject="hi hi",message="ha ha ha";
SmtpMail.Send(from,to,sunject,message);
//this line of code will send mail to your friend.
Here we won't get that much flexibility to compose our message part. If you want to use nicely formated body and message part. then you need to go for the second fasion(next example).
2. use MailMessage class to create mail.
eg. MailMessage Msg=new MailMessage()
After creating object of MailMessage class you are absolutly free to give what ever modification that you wan.
Please check the members avilable in our Msg object. All are self explanatory
and then use
Smtp.Send(Msg)
Bfore sending mails don't forget to give your Smtpmailserver name.
eg:
SmtpMail.SmtpServer="YourSmtpServerName";
bye
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
1. Using System.Web.Mail.SmtpMail is not a good idea. It relies on CDO which is provided by Microsoft Exchange, Outlook XP and above (maybe 2000, but I don't remember), and Microsoft Virtual SMTP Server, all of which may or may not be installed. The best way is to write a simple SMTP client yourself which is very easy for composing basic mail messages and sending them. We've covered this in this forum before, so try a search.
2. Hotmail doesn't expose SMTP services. It uses HTTPMail, a proprietary protocol. If you're trying to send mail through Hotmail, you must use this protocol. Read Hotmail using C# – A HTTPMail client under .NET[^] for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hello everybody.
i wnat to close the form automatically after a specific time ,say "10 seconds".
please help me..
thanks 4 u all.
|
|
|
|
|
Create a Timer on the form and set the interval to 10 seconds. Create an event handler that will close the form when the timer's event fires.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Just don't forget to enable the timer, it defaults to disabled.
I spent a while trying to figure out why my timer event's were not firing the first time i used one!
DOH!!
Kev Pearman MCP
|
|
|
|
|
hi,
How can i change the backcolor of tab control including their caption part(all different tabs in that tab control).
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I found out my self. So i am not expecting any answers.
thanks
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
sreejith ss nair wrote:
I found out my self. So i am not expecting any answers.
Maybe someone else is. Maybe someone with a similar problem read your query this morning and thought "That sounds like the problem I'm having. I'll have a look again later and see if anyone else replied." So, now that person is disappointed because you know the answer but didn't tell anyone.
Good etiquette would dictate that you should tell the rest of us the answer to help educate us all - even those who were not seeking the answer to your question may find something useful after all.
Now, what's is the answer to the question, o' great wise one?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
That's funny - thinking that someone would actually try searching this forum before posting a question for the "umpteenth" time.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I live in eternal hope.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
HI,
Actually i post this above question yesterday.See my habbit is i won't sit and wait for answer. if i don't know any concept i will post my queary here in codeprooject and simultaniously i will try my leval best to figure it out.
That's why i wrote that " I got answer and not expecting answers....
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
sreejith ss nair wrote:
See my habbit is i won't sit and wait for answer. if i don't know any concept i will post my queary here in codeprooject and simultaniously i will try my leval best to figure it out
That is very commendable, however that was not the reason for my post. The reason for my post was that you announced to the world that you knew the answer, but you did not tell the world the answer. You kept the answer to yourself. CodeProject is for sharing information.
It is good manners, if you find the answer to the question you asked, to tell everyone that (1) you found it [which you did] and (2) what the answer is [which you did not].
So, I repeat: What is the answer to your original question?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Who is going to draw ?
Tabcontrol have a properties called DrawMode. This will set or get the value that whether user or system will paint the caption.By default it is normal. Means system(OS) will paint the caption for you. If you(parent form) want to draw the caption you have to set the value of the property to OwnerDrawFixed.
You can mention DrawMode on design time or runtime like below mentioned code.
this.tabControl1.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
Now you mention who is going to draw the caption.
Next thing is how is going draw ?
Tab control have an event called DrawItem event which will occure when ever an area need to be painted.
eg:
this.tabControl1.DrawItem += new DrawItemEventHandler(this.tabControl1_DrawItem);
private void tabControl1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
Font f;
Brush backBrush;
Brush foreBrush;
if(e.Index == this.tabControl1.SelectedIndex)
{
f = new Font(e.Font, FontStyle.Bold | FontStyle.Bold);
backBrush = new System.Drawing.Drawing2D.LinearGradientBrush(e.Bounds, Color.Blue, Color.Gold, System.Drawing.Drawing2D.LinearGradientMode.Vertical);
foreBrush = Brushes.White;
}
else
{
f = e.Font;
backBrush = new SolidBrush(e.BackColor);
foreBrush = new SolidBrush(e.ForeColor);
}
string tabName = this.tabControl1.TabPages[e.Index].Text;
StringFormat sf = new StringFormat();
sf.Alignment = StringAlignment.Center;
e.Graphics.FillRectangle(backBrush, e.Bounds);
Rectangle r = e.Bounds;
r = new Rectangle(r.X, r.Y + 3, r.Width, r.Height - 3);
e.Graphics.DrawString(tabName, f, foreBrush, r, sf);
sf.Dispose();
if(e.Index == this.tabControl1.SelectedIndex)
{
f.Dispose();
backBrush.Dispose();
}
else
{
backBrush.Dispose();
foreBrush.Dispose();
}
}
}
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
hi Colin Angus Mackay ,
I am really sorry for this late posting of my answer. I want this sort of suggections in future also. ;P
**************************
S r e e j i t h N a i r
**************************
|
|
|
|