|
i written bellow code under printDocument1_PrintPage event
Font f = new Font("Arial", 14, FontStyle.Regular);
Brush b = Brushes.Red;
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
for (int j = 0; j < dataGridView1.Columns.Count; j++)
{
e.Graphics.DrawString(this.dataGridView1.Rows[i].Cells[j].Value+" ", f, b,j * 5,i * 5);
// e.Graphics.DrawString(this.dataGridView1[i, j] + " ", f, b,j*5, i * 5);
}
}
under print button click event code as
printDocument1.DocumentName = "authors";
printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.ShowDialog();
problem is i am getting screen with some red color. i am not getting datagrid rows
hep me
|
|
|
|
|
maybe 5*5 is too small to hold your cell content. Try a width>=50 and a height>=15
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
|
Er, what? If you want to know what event is raised when a form is Refresh'ed, the Paint event is fired. If you want to know how to refresh a form, then use the Refresh method. If your form flickers, use a double buffer. I can't say more than that unless you provide a little more information.
|
|
|
|
|
How can I use a double buffer?
|
|
|
|
|
Write to a bitmap instead of the screen. On the Paint event, draw the bitmap.
|
|
|
|
|
You've given no more information than the person who's thread you hyjacked. SWtart you're own thread and provide a lot more detailed about what your issue is.
|
|
|
|
|
Computafreak's answer is enough for me, I didn't start a thread because I don't have an issue, I was just curious and wanted to ask a small question.
And of course the owner of this thread won't be able to get a proper answer because his question consists of three words.
|
|
|
|
|
A 7 word question is of the same quality, so you'd get about the same answer.
|
|
|
|
|
rule #1 in "how to answer a question" really should be: always keep the answer as short as the question".
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
|
Press F5
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.
|
|
|
|
|
Wow. Just...Wow.
|
|
|
|
|
It must be Thursday... I never could get the hang of Thursdays.
|
|
|
|
|
|
Buy a book
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.
|
|
|
|
|
delete
modified 2-Apr-21 5:24am.
|
|
|
|
|
Put each IP Search onto a separate thread.
Whatever you sdo though the network response time is likely to be the limiting factor.
|
|
|
|
|
IMO bad advice. Using a few threads will help, launching tens or hundreds will result in hitting a bottleneck or a deliberate limitation inside the TCP/IP stack.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
This is really bad advice. Did you know that your allocating 1MB of RAM PER THREAD you create and keep running?
I'd look at using the managed thread pool before I start launching threads by the hundreds.
|
|
|
|
|
how would you change the code that it scan it fast or what would you add everybody said an other solution!
|
|
|
|
|
I'd design it so that I'd have about 5 or 10 or so threads all pulling IP addresses from a queue. Each of these workers would get an IP address, do it's job, report back, and then go get another address. You do NOT create a new thread for each IP address.
|
|
|
|
|
Hi
I have two ObservableCollections of an UserDefined Class which have an ID Property ,now i want to maintain 1 ObservableCollection locally and get another ObservableCollection from the DataBase,After i get them in one place i want to Compare those 2 ObservableCollections and delete the ID's from the local ObservableCollections which are not present in the ObservableCollections which is latest one(from Database).can some one give me the code for achieving this functionality.....Thanks in Advance
|
|
|
|
|
ramk_chirra wrote: can some one give me the code for achieving this functionality.....
That's not really the way that the forums work. If you have code that doesn't work, we will try to help you fix it, we won't write it for you.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
ramk_chirra wrote: Compare those 2 ObservableCollections and delete the ID's from the local ObservableCollections which are not present in the ObservableCollections which is latest one(from Database)
Why don't you have only one collection and each time you clear it and fill with latest data from DB? This will avoid unnecessary looping and deletions from one collection.
|
|
|
|