|
Can anyone please explain to me how I could easily send the contents of a winform to the printer?
Example: I want to generate a searchable database for work orders.
I have it where I can add the record if no already there, i can update it, and search for it.
I wanted a way to print the record once it is found. Much like this
Logo Goes Here
Route Number [ ]
Meter Number [ ]
Problem [ ]
Sign ______________
Date ______________
A great tutorial or a reference to a book explaining this would be great. My C# skills are not as good as I would like them to be but none the less I'm willing to learn if someone is willing to teach. Thanks again.
Win32newb
"If I wrote a book like I code. It would be one page thick and contain only one word (DUH!)"
|
|
|
|
|
One of the top two articles when you search for 'print form' here on CodeProject are probably all you need.
|
|
|
|
|
1)To personalize the uninstall icon that is showed in install/uninstall programs, how i can do?
2)I need to make more "xp styled" the install wizard forms, for example the progress-bar is flat style, i want to see the xp one. How? Some button is much big, i want to reduce. how?
3)if i make right-click on the desktop shortcut for my application .exe and i go in property window, i can see the Destination target but the button "Find Destination" is disabled, why?
4)if i want to personalize the setup wizard form with a top bitmap own, i need to load a bitmap in application directory for example and set it for the form.
The problem is at the end of the installation the bitmap is created just in the directory of .exe. I don't want it! It work the same also for icon of shortcuts.
How can i avoid to installing also these files?
|
|
|
|
|
4) For files in your setup you can set the Exclude property to true. This way you can use them in the setup but they will not be copied to the application directory.
|
|
|
|
|
Is there anyway to pull data from microsoft money into a C# application? If anybody knows how or has any good resources for me, that would be greatly appreciated.
JGA
|
|
|
|
|
|
I don't know if I can connect to microsoft money using oledb, how would I find that out?
JGA
|
|
|
|
|
I want to do this in .net v2 beta 2 with c#, does anyone know how to do this?
IM PROUD TO BE A GMAIL;
|
|
|
|
|
What's wrong with Directory.CreateDirectory() ?
mav
|
|
|
|
|
THX
IM PROUD TO BE A GMAIL;
|
|
|
|
|
Example,
Is this what you meant???
System.IO.Directory.CreateDirectory(@"D:\NewFolder\NewSubFolder")
Regards,
Mahesh
|
|
|
|
|
Hi!
I need some help with how to save a bunch of strings into an ANSI-text file and not the standard UTF-8. The reason for this is that the application that uses this text file does not like UTF-8 when a special character is involved (like Swedish åäö etc). Does anyone have any good ideas or sample codes out there to save a file into ANSI instead of UTF-8?
|
|
|
|
|
Hi!
When you create a FileStream you can specify an encoding to use. There you can use Encoding.ASCII to get non-UTF8 text files.
mav
|
|
|
|
|
As usually... It was too easy. Tank you very much .
|
|
|
|
|
CultureInfo culture = new CultureInfo("el-GR");
int codePage = culture.TextInfo.ANSICodePage;
Encoding GreekEncoding = Encoding.GetEncoding(codePage);
then at this line :
new StreamWriter(destinationpath, false, GreekEncoding);
|
|
|
|
|
I try to get some data from a .mdb file, but it fails with a realy weird and long exception, here is my code:
public DataSet getTranslation(int language)
{
DataSet translations = new DataSet();
String connes = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Documents and Settings\\Johan\\My Documents\\languageDB1_00.mdb";
String sql = ("SELECT Translation, PhraseKey FROM Translation WHERE languageID = " + language + ";");
OleDbConnection conn = null;
conn = new OleDbConnection(connes);
//"SELECT Translation, PhraseKey FROM Translation WHERE languageID = " + language + ";";
try
{
OleDbCommand command = new OleDbCommand(sql, conn);
OleDbDataAdapter adapter = new OleDbDataAdapter(command);
conn.Open();
adapter.Fill(translations, "Translation");
return translations;
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.ToString());
return null;
}
finally
{
conn.Close();
}
}
The exeption message begins with:
IErrorInfo.GetDescription failed with E_FAIL (0x80004005)
please help...
john
|
|
|
|
|
Hello John,
The problem is because of the usage of the keyword "Translation" as in OLEDB.
If you change the SQL to
String sql = "(SELECT [Translation], PhraseKey FROM [Translation] " + <br />
"WHERE languageID = " + language + ")";
the snippet will work fine.
Regards
Mahesh
|
|
|
|
|
Hello folks,
i'm not a C# expert so i have a question to do.
I want to fetch the external ip of a machine whin is linked at a router.
All the HowTo i have seen didnt help me
If anyone can help I would be grateful.
Thanks
Enrico
|
|
|
|
|
I want to draw a triangle on the end of a line (vector).
I know how to do it brute force. Is there a better way?
Thanks a lot...
|
|
|
|
|
How would we know what "brute force" is to compare it to a better method? You have to post some code or supply some explanation of how you're doing it now. Also, the "best way" depends on the situation that the code is being used in. Do you need to draw this triangle in a certain position all the time, does it have to function as an arrow pointer, following the slope of the line? ???
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Point taken.
What I want is a triangle at the end of a line just as in the hands of a clock (it's not a clock).
By by "brute force", I meant a set of 3 connected points
Placed at the other end of the line.
|
|
|
|
|
Have you looked at the LineCap's of a Pen? Click[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Wow. I had no idea.... thanks. Not to get too greedy here, but is it possible to use it for the
technique here? Or will I have to re-write most of it.... thanks again
/////////////////////////////////////////////////////////////////////////////////////////////////////
public Pen[] activePen = new Pen[] { new Pen( Color.Blue, 2 ), new Pen( Color.Green, 2 ), new Pen(Color.Red, 2) };
private int _penIndex = -1;
/////////////////////////////////////////////////////////////////////////////////////////////////////////
private Pen GetNextPen()
{
_penIndex = (_penIndex + 1) % 3;
return activePen[_penIndex];
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
g.DrawLine(GetNextPen(), 250, 250, x, y );
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
Sure you can, but you will have to initialize the array of Pen somewhere else (for example in the constructor):
private Pen[] activePen;
public MyClass() {
activePen = new Pen[] { new Pen( Color.Blue, 2 ), new Pen( Color.Green, 2 ), new Pen(Color.Red, 2) };
activePen[0].EndCap = System.Drawing.Drawing2D.LineCap.Round;
activePen[1].EndCap = System.Drawing.Drawing2D.LineCap.Triangle;
activePen[2].StartCap = System.Drawing.Drawing2D.LineCap.Triangle;
activePen[3].EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
}
Now all your pens have different kind of caps. You can als play around with the other properties of the Pen (like Dash...). You should also look at the CustomeStartCap/EndCap properties. With them you can define special caps (if needed).
|
|
|
|
|
Hello,
in the help it says Varchar of the Type OleDBType is mapped to string of the .Net framework. How can i get this information if i have the OleDBType? because i can't find it anywhere this information.
greetings
Sander
|
|
|
|