|
Thanks Navaneet for the response.
Still i have a problem. The problem is that 'DrawtoBitmap' gives a snapshot of the size of datagridview only. It doesn't give all the records like we have some hidden records in the datagridview which gets visible only by scroll bars.
I need to have all the records in the datagridview to be converted into a image so that i can embed it into a mail.
My requirement is to display a data obtained from a database onto a windows application. I want to embed that data into email in tabular form.
I would appreciate if there is any other way of achieving this.
Thanks in advance
Praveen Raghuvanshi
|
|
|
|
|
Hi,
I need to determine the location of label text in pixels as Margin, Padding, and TextAlign properties change
|
|
|
|
|
no,
you need to ask your mother to teach you some manners!!!!
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Thanks for your answer, but sorry it doesn't help
I advice you to ask your mother to teach you some attitude manners
|
|
|
|
|
Thanx for the 1 vote...
some of us are professional developers with alot of work to do and we dont have time to read pointless posts like yours, we keep an eye on these forums to help people to solve problems they are having.
NOW WHO THE HELL DO YOU THINK YOU ARE comming in here, and DEMANDING that we do YOUR WORK for you? are you stupid or something? no one here or anywhere else will do your work for you.
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Hi Harvey
My post is not pointless, I think you didn't understand it as you may be "stupid or something"
My problem is that, I'm working in an application in which I manually simulate some control appearance and draw them in a high resolution image to be printed, now when drawing a Label I need to determine the point(X, Y) on which I print the Label text, as Label.TextAlign may vary from MiddleCenter, to BottomLeft, to TopRight, etc.
Now, can you - as a "Professional" developer - help me??
I don't think so..
Even if my question is pointless, it's not enough reason for you to insult me
Sorry, but you are not a respectable person
|
|
|
|
|
Ahmad Safwat wrote: the location of label text in pixels as Margin, Padding, and TextAlign properties change
You won't get the location of the text, you can take location of the label instead. Check label.Bounds which gives you a Rectangle instance.
|
|
|
|
|
Sorry, but I don't understand how could label.Bounds help me to determine the location of text on Lable??
|
|
|
|
|
The bounds (which is type Rectangle) has members for top, bottom, right, and left. (left, top) gives you the location of the label's upper-left corner.
|
|
|
|
|
I guess if you want to know where exactly the text is painted within the label, you'll have to get the control's graphics object, determine the text size with its MeasureString methhod, and calculate the position with a lot of if statements according to alignment and things. But that's kind of like reinventing the label.
|
|
|
|
|
Hi Frank
yes that is exactly what I need and I already calculated the position but it's not accurate, so I was asking if there is an existing method to do
|
|
|
|
|
Hey, can anybody help me?
|
|
|
|
|
as in VB 6.0 we have recordset.movelast what is it in asp.net using C# where database is sql server 2005?
|
|
|
|
|
There is no equivilent in ADO.NET, it works in an entirely different way. Your best bet is to Google ADO.NET and read up on datareaders and datasets.
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
The SqlDataReader has no such method, please take a look at this below:
SqlDataAdapter s = new SqlDataAdapter("...sql...", Conn);
DataTable dt = new DataTable(); ;
s.Fill(dt);
DataRow dr = dt.Rows[dt.Rows.Count - 1];
Hope it's usefull for you!
Regards,
Dealon
Impossible is nothing!
|
|
|
|
|
I want to have a tree node selected when the page loads. I have the number or ID or value of the node when the page loads. how do i achieve this? please help.
|
|
|
|
|
Hi.
first you have to find the node:
TreeView.Nodes.Find
Then select it:
TreeView.SelectedNode = <your selected node>
And you can do other stuff:
TreeNode.Expand();
TreeNode.EnsureVisible();
Kjetil
|
|
|
|
|
Hi Kjetil,
Thanks a ton.
It didn't work. Maybe you are talking about a windows-based TreeView control. I am using the control on a webpage. The TreeView.Nodes.Find function doesnot exist.
|
|
|
|
|
shehezada wrote: TreeView.Nodes.Find function doesnot exist
In that case you may have to iterate through all the nodes and check it's value/ID or whatever you need - when you find a match, set the selectednode property and break out of your loop.
Dave
|
|
|
|
|
Hi
Sorry. My mistake.
I'm in a big WinForm project, and have "forgotten" all about Web
Kjetil
|
|
|
|
|
Hello,
I want to know how to send mail from a windows application.
Thanks.
Dad
|
|
|
|
|
If you go to the top of this page you will see a textbox labeled SEARCH. Try that, there are loads of articles and code samples. If that doesn't help, try Google, again there are lots of very good examples.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
include
//---------------------------------------------------------------------------
using System.Web.Mail;
public static string SendMail(int pintUserID, string pstrMailTo, string pstrMailBcc,string pstrMailCc,string pstrMailSubject,string pstrMailBody,string pstrAttachFilePath)
{
try
{
MailMessage objMail = new MailMessage();
objMail.From = System.Configuration.ConfigurationSettings.AppSettings["FromEmailID"];
//objMail.From =System.Web.HttpContext.Current.Session["OfficeEmailID"].ToString() ;
objMail.To = pstrMailTo;
objMail.Bcc = pstrMailBcc;
objMail.Cc = pstrMailCc;
objMail.Subject = pstrMailSubject;
MailAttachment Attachment = null;if (File.Exists(pstrAttachFilePath))
{
Attachment = new MailAttachment(pstrAttachFilePath);
}
objMail.Attachments.Add(Attachment);
SmtpMail.SmtpServer = "localhost";//System.Configuration.ConfigurationSettings.AppSettings["SMTPServerIP"];
SmtpMail.Send(objMail);return "TRUE";
}
catch(Exception Ex)
{
return Ex.Message;
}
}
Config file
<add key="SMTPServerIP" value="192.168.1.11">
call the function SendMail & enable your system SMTP server.
Thanks & Regards
|
|
|
|
|
If you provide answers to fools to lazy to use Google you will only encourage them.
Simon
|
|
|
|
|