|
HideSelection will not work for this instance and changing the BackColor will not address the issue I have. My button moves the selected node up and down. Since it is no longer the focus, it turns from medium blue to light gray. I did however figure out how to override WndProc:
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
switch (m.Msg)
{
case (15):
{
PaintEventArgs pae = new PaintEventArgs(
Graphics.FromHwnd((m.HWnd)),
new Rectangle(0, 0, this.Width, this.Height));
OnPaint(pae);
break;
}
default:
{
break;
}
}
}
Thanks for trying!
|
|
|
|
|
Hi All,
I am working on a c# tool to copy part of excel rows to another excel sheet.
i.e i want to copy row 5 to row 10 in Excel1 and create a new exce2.
any sample code will be helpfull.
Regards,
Kasi
|
|
|
|
|
Well, there are a couple of options.
You can use Office Interops to read the excel file and then create the second with the data of your interest.
Another way can be to read the excel sheet using the ADO connection into a dataset and you can write the selected rows as a xml file (using Dataset.writeTo method). Excel can easily read the xml file.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
Thanks for your quick reply. Can you send me some sample code.
Regards,
Kasi
|
|
|
|
|
What have you tried already? Have you researched how to do read and write from excel files? Many people don't like doing work for free, and 'sample' code exists on the internet everywhere, if you have tried using google that is.
|
|
|
|
|
Thanks, I got some code on google.
|
|
|
|
|
Hi guys.
Can we send email in C# (WinForm) with our free YahooMail or Gmail account ?
Thanks.
|
|
|
|
|
Did you try this[^] before posting your question?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thank you.
I've found the answer.
try
{
NetworkCredential loginInfo = new NetworkCredential("username", "password");
MailMessage msg = new MailMessage();
msg.From = new MailAddress("something@gmail.com");
msg.To.Add(new MailAddress("sth@sth.com"));
msg.Subject = "Email Subject";
msg.Body = "Some text";
msg.IsBodyHtml = true;
SmtpClient client = new SmtpClient("smtp.gmail.com");
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = loginInfo;
client.Send(msg);
MessageBox.Show("Your password has sended to your email", "Email sended", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
|
|
|
|
|
Hi Guys,
I have the following out put from Sql data adapter(sda)
WebRequest req = null;
WebResponse rsp = null;
Dataset ds=new dataset();
Sda.fill(ds)
string xmlDs= ds.Getxml();
string fileName = xmlDs;
string uri = "http://www.webpage/default.appx";
req = WebRequest.Create(uri);
//req.Proxy = WebProxy.GetDefaultProxy(); // Enable if using proxy
req.Method = "POST"; // Post method
req.ContentType = "text/xml";
I would like to Encript the Xml data before sending it accross.How would i go about it?
Thank you in advance.
|
|
|
|
|
The Cryptography namespace is where you need to go. Thing is, do you want to encrypt the XML ( which will mean it's not XML anymore ), or some of the data IN the XML ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi All,
i have a code (below), it take 2 variables, the first being the server name and the second being the eventID to look for in the Directory Service eventlog.
it seems to work fine for all eventID's except the one im looking for - 1394, where it always shows nothing!!
any ideas?
EventLog el = new EventLog("Directory Service", args[0].ToString());
foreach(EventLogEntry i in el.Entries)
{
if(Convert.ToInt32(i.EventID) == Convert.ToInt32(args[1]))
{
Console.WriteLine(i.EventID.ToString() + " - " + i.TimeWritten.ToShortDateString());
}
}
|
|
|
|
|
lane0p2 wrote: it seems to work fine for all eventID's except the one im looking for - 1394, where it always shows nothing!!
Probably, there is no event for this id
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
there is!!
i was looking at the eventviewer and ended up testing loads of ID but only 1394 failed.
i just can't figure it out!
|
|
|
|
|
Hey buddys...........I was trying to use an animated picture pox which acts as a button in my application...................So what I wanted was,when the user mouseEnter in to this picture box i wanted to show another picture box which is the same as that picture but the brightness is more than the previous picture box.................I done it easly by going to photoshop and adding a brightness on the picture.............. But I have a lot of picture boxes as the above one which makes my application very slow...... .........So i came with an idea of using Photoshop reference(CS3 photoshop dll file) and want to add a brightness to that picture in a code.................... So please any body with an idea it is nice to me........ thnak you
|
|
|
|
|
First, yoiu don't use picturebox's this way. All you do is use a button, set it's Image property to the dimmed image. Handle the MouseEnter and MouseLeave events of the button. In those handlers, just change the Image property to point to either the dimmed or brighted image as appropriate. No pictureboxs involved at all.
BTW - the more controls you have on a form, the slow it renders. The only way to speed things up is to reduce the number of controls on the form.
|
|
|
|
|
Thank you man. That is also a good idea............ But to make my customers happy ......i should use this ways ...... because it looks more nice on the picture box than on the button................. by the way i can also make what you said on the picture box.................. thank you
|
|
|
|
|
matiIsGreat wrote: But to make my customers happy
Is it only me or you guys also thought that ?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I'm trying to create a custom treeview that will draw a blue rectangle over a selected node and then redraw the text over it. Is there any command that can help me find the (x,y) coordinates of the node? The node can be selected by either mouse, keyboard, or a button. Any suggestions?
|
|
|
|
|
How about using the Bounds property of the node? that good enough for what you want?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Yup, funny. I've been googling all morning and I just came upon bounds a minute before you answered. Thank you for the reply!
|
|
|
|
|
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
|
Hi,
satigar123 wrote: hi
great
But that's not exactly an answer is it
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi i have a dtaset that contains a table with 2 fields, i want to use thius to create a bar graph,
on field is a company name and the other field is a profit value, i want to show on the graph each comapny(x axis) with their profit values(y axis) as the bars on the bar graph.
can anyone help me with this.
thanxs
|
|
|
|