Hi..
in following code this error is happening,(A new expression requires () or [] after type) I can't understand what is missing..
StringFormat format2 = new StringFormat {
Alignment = StringAlignment.Center,
LineAlignment = StringAlignment.Center,
FormatFlags = 0x800
};
Kindly any body help..
Loading

Suthish NairRank #92 · 22.8K reputationPosted May 17, 2011, 2:05 AM EDT
VulpesRank #55 · 29.2K reputationPosted May 17, 2011, 1:09 AM EDT
VulpesRank #55 · 29.2K reputationPosted May 17, 2011, 2:30 AM EDT
This is because object initializers do allow you to omit the () if there's a parameterless constructor which there is for the StringFormat class.
If you are using one of these earlier versions, then you've no choice but to do it Suthish's way.
Suthish NairRank #92 · 22.8K reputationPosted May 17, 2011, 2:56 AM EDT