|
Hi, I want to display 2 pages with different data when i do the printpreview. I created two document objects with a single printPreviewDialog object and assigned each document object but it display only one doucment page. Can some body help me how to solve this issue.
Thanks
PrintDocument pd1 = new PrintDocument();
PrintDocument pd2 = new PrintDocument();
PrintPreviewDialog ppd1 = new PrintPreviewDialog();
ppd1.Document = pd1;
ppd1.Document = pd2;
ppd1.ShowDialog();
|
|
|
|
|
To print two or more pages -even if they contain different data-, you should ruse a single PrintDocument object. In the PrintDocument.PrintPage event set e.HasMorePages = true , until you print al the data you want.
Revise the C# articles - printing section[^] for more details.
Regards
|
|
|
|
|
Great it works for me thanks
|
|
|
|
|
Since Redim does not exist in C#, How do I convert this in C#?
Dim basePoints() As Double
ReDim basePoints(AUTO_PTS - 1, 1)
|
|
|
|
|
Use one of the Collection classes which is designed for better array handling. Take a look at classes like the ArrayList to see how they help.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
There is no equivalent. You can do it yourself with something like this (unchecked, but you get the idea):
double[] NewBasePoints = new double[newsize + 1];
if (thisArray != null)
System.Array.Copy(thisArray, NewBasePoints, System.Math.Min(thisArray.Length, NewBasePoints.Length));
BasePoints = NewBasePoints;
|
|
|
|
|
You're thinking of 'ReDim Preserve'.
The OP was dealing with the simpler 'ReDim'.
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: VB to Python converter
|
|
|
|
|
(via Instant C#)
double[] basePoints = null;
basePoints = new double[AUTO_PTS,2];
ReDim Preserve is a little trickier, but also has a C# equivalent.
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: VB to Python converter
|
|
|
|
|
Hi All,
I'm trying to create a resizable form with a little bit of auto layout.
Basically I have 7 square buttons grouped into a panel. These buttons must never be split up with any auto layout code.
To the right of the buttons I have a trackbar control. I want the trackbar to grow and shrink as the window gets wider/narrower, but, when the shrinkage would result in the trackbar being below a minimum size (in fact, the width of the button containing panel), i want it to drop to below the buttons.
This image shows my controls - here
Can this be easily done with built in winforms stuff? or must I implement it the long way with various resize event handlers and manual repositioning code? I'm hoping to leverage AutoLayoutPanel - because I will have other controls on the form too, eventually.
Thanks
Jon
|
|
|
|
|
Will this[^] article (EZ layout mgr) help?
/ravi
|
|
|
|
|
Check out the FlowLayoutPanel control. It dynamically adjusts the controls within it to fit, and as long as you group things using panels/groupboxes/etc, they'll stay together.
|
|
|
|
|
What's deal with
treeView1.Nodes.Reverse
'System.Windows.Forms.TreeNodeCollection' does not contain a definition for 'Reverse'
What's the trick to reverse enum a treeview?
Thanks
|
|
|
|
|
er, iterate through the collection backwards?
|
|
|
|
|
edboe wrote: er, iterate through the collection backwards?
ER, yes.
|
|
|
|
|
I need to remove nodes that don't hit a search query, and leave the nodes and their parents.
|
|
|
|
|
I am new to c# so please bare with me...and not laugh to hard at my question.
I can't get onto the MSDN site and since my help menu isn't working correctly I figured I would post my question here.
I was trying to see if there was a way to specify the precision while using double.ToString()? I have a double that returns to me a double with 10 digits after the decimal. I would like to just have it return 3 digits after the decimal.
Do I have to manipulate it using the string.Format or is there a way to do it in the ToString()?
Thanks in advance.
|
|
|
|
|
Try double.ToString("F"), which is uses the same format specifiers as String.Format.
[edit]Sorry, I missed the "3 decimal places" bit. As was pointed out, you want to do ToString("F3") instead.[/edit]
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Thanks....i figured it was something simple, I just didn't think to put it in parenthesis <doh>
|
|
|
|
|
|
Use the formatting string "F3" to get three decimals.
The String.Format method uses the same formatting style as the ToString method. String.Format("{0:F3}", f) produces the same result as f.ToString("F3") .
---
b { font-weight: normal; }
|
|
|
|
|
Hello all,
i am new to C# and there is something i can't get to work, so i a requesting your help !
simple code :
namespace ConsoleApplication1
{
class Father
{
public Father()
{
System.Console.WriteLine("Build Father");
}
public void Something()
{
System.Console.WriteLine("Father : Something");
SomethingElse();
}
public void SomethingElse()
{
System.Console.WriteLine("Father : SomethingElse");
}
}
class Son : Father
{
public Son()
{
System.Console.WriteLine("Build Son");
}
public new void SomethingElse()
{
System.Console.WriteLine("Son : SomethingElse");
}
}
class Program
{
static void Main(string[] args)
{
Son s = new Son();
s.Something();
}
}
}
this simple code displays "Father : SomethingElse" at the console.
How to get "Son : SomethingElse" at the console without rewriting Son.Something() ?
Many thanks for your help !
|
|
|
|
|
Just declare SomethingElse as a virtual function in Father and override it in the Son class.
class Father
{
public virtual void Something() {...}
}
class Son : Father
{
public override void Something() {...}
}
|
|
|
|
|
just declare the somethingelse in father as virtual and override it in the son class.
-Prakash
|
|
|
|
|
thank you very much for helping a poor newbie like me !
|
|
|
|
|