|
hi
i am use .net 2.0 (vs2005)
i was add printdocument to my form and add printpreviewdialog also and set printpreviewdialog.document to printdocument, but when i compile my app printpreview dialog appear but nothing exist in it (it's empty)..
i have a datagridview in my form with many records .. i want to print datagridview records ..
how to do that and if i want to print multipage how to do ??
thanks ..
|
|
|
|
|
in order to print you need to draw using the graphic object of the eventargs on the onPrint event.
If you're looking for an easy way, you can check out for printablelistview in the site. this listview contains a print() method that prints a listview.
if you'de like to print a form you can check out:
http://www.codeproject.com/dotnet/PrintingFormReport.asp[^]
for printing forms.
hope it helps.
|
|
|
|
|
OK, so I'm working on a little app, and I read about this new settings stuff, so I thought I'd give it a go. I've added a lot of stuff to a settings file and generated a class to read/write it, it looks something like this:
public class UserSettings : ApplicationSettingsBase
{
[UserScopedSetting()]
[DefaultSettingValue("1")]
public double SlideshowSpeed
{
get
{
return (double)(this["SlideshowSpeed"]);
}
set
{
this["SlideshowSpeed"] = value;
}
}
// etc
The help is useless, it seems to mostly be VB only. However, while this seems to work, it always returns the defaults. The properties in the app.config are matching the names in my class, as you can see. I have tried making them ApplicationScoped, as I realise I don't have a user named config file, nor do I see where to find one.
Then I read that Properties.Settings should give me a strongly typed collection of the items in my settings file. No, that plain does NOT work, in any way shape or form, despite all the examples on the web that indicate it should.
Is this stuff broken, or just really poorly documented ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I tried using the Settings classes autogenerated by the IDE and it worked fine. I found that the changed settings are not reflected in the exe.config file, instead, it's stored in the user's profile directory (C:\Documents and Settings\<UserName>\Local Settings\Application Data\....\WindowsApplication1.exe_Url_ivvf3kg5nf2omiqzptjeklawxynwvil5\1.0.0.0\user.config). The code I used to read and modify the values is pretty plain
MessageBox.Show(Properties.Settings.Default.TestSetting);
Properties.Settings.Default.TestSetting = "ItWorks";
Properties.Settings.Default.Save(); Hope this helps.
|
|
|
|
|
OK - how did you get that far ? I've added settings and they are NOT available to by via that sort of code, that's exactly what I tried.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Nothing special, I created a new WinForms project, double clicked Settings.settings on Solution Explorer, added my custom setting (TestSetting ). Built the project and that was it, I got Intellisense recognizing the TestSetting property on Properties.Settings.Default . FWIW, I'm using the Express Edition, not VS .NET 2005.
|
|
|
|
|
How do i record the sound from the microphone?
Any links or code will be appreciated.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
Hey Everybody!
I'm trying to send a file through a network using TCP client.
for small files I had no problem, but when I got to bigger files I had to find a solution to the buffer problem.
To do that I "cut" the file into chunks, and sending each time a chunk at size 65000. now, everything is going well and the file does go through, but the problem is that the file gets to the other computer corrupted. The file size on the two computers is identical, but its still corrupted.
any ideas anyone????
Thanks!
|
|
|
|
|
If you have writen seperate sender and receiver, there may be some difference in sending and receving variable data type I mean the size may differ.
Mujtaba
|
|
|
|
|
TCP does not preserve message boundaries. You must pay attention to the return value of GetStream().Read - this will tell you how much data was returned in a particular call. The remaining bytes in the buffer passed to Read will have the same value as they had before the call was made.
Remember that network streams deal in bytes. If you're sending a text file and reading it as text into string variables, ensure that you use the same Encoding on both ends to convert to and from byte[] buffers.
|
|
|
|
|
Could please someone tell me what are the pre requsites for a C++ dll to be used in C#. I am having problem in using C++ dll in my C# code.
Mujtaba
|
|
|
|
|
It needs to export something, either as a normal dll, or through COM or .NET. Perhaps if you gave us some details ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to use a normal dll that contains a simple class and I want to create an object of that class in my C# code.
Mujtaba
|
|
|
|
|
I'm not sure if you can do that, because I don't believe you can use p/invoke to export a class from a C++ dll.
Why don't you want to use managed C++ ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am not having detailed concept of that but now I am starting managed C++. Could you give me any links about it?
Mujtaba
|
|
|
|
|
Nish has written heaps of articles about it, and has a blog as well, I'd read those.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
OK Thanx very much.
So nice of you.
Mujtaba
|
|
|
|
|
Hi,
How do you add a new line to a textbox like in the following:-
<br />
textBoxMemberNotes.Text = File.ReadAllText(filename) &CrLf +now;<br />
Glen Harvy
|
|
|
|
|
textBoxMemberNotes.Text = File.ReadAllText(filename) + Environment.NewLine + now;
---
b { font-weight: normal; }
|
|
|
|
|
I just new it would be easy BUT do you think I could find a reference to that anywhere on the net
Thank you
Glen Harvy
|
|
|
|
|
|
Ah yes - but if you know what terminology to search for then you probably don't need to search for it
Glen Harvy
|
|
|
|
|
first set the multiline property of your text box to true.
Then try this:
<code>textBoxMemberNotes.Text = File.ReadAllText(filename) + "\r\n";</code>
Hopefully, this should work.;)
'Tilewa
|
|
|
|
|
how can i get a childnode value in a treeview into c# winprogramming.i want to get the child node value in a particular treeview
dcjoshi2
|
|
|
|
|
Here's a simple example to get you started:
TreeNode selectedNodesFirstChild = this.treeView.SelectedNode.Nodes[0];
Just Google it.
Failing that try phoning
|
|
|
|