|
Hello,
I need help in"Master/details form" what does it mean?
Thanks.
Dad
|
|
|
|
|
Here is a general explanation of what "Master-details form" is.
Here and here are some explanations on how to create it with VS2005.
here is the article on CodeProject related to it.
Hope it helps,
- Dmitry.
-------------------------
Listen up! Teamwork means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Is there an IList implementaiton that fires a change notification when the list is moified (items added, removed, list cleared)?
|
|
|
|
|
I found WIntellect PowerCollections provide ListBase<t> class that makes implementing this fairly easy. (not terribly efficient, but ah well )
|
|
|
|
|
peterchen wrote: Is there an IList implementaiton that fires a change notification when the list is moified (items added, removed, list cleared)?
Off the top of my head...
Does the BindingList collection fit the bill? It implements the IBindingList interface which has an event for change notification (I also think it implements the IList interface, but don't hold me to that).
|
|
|
|
|
That looks almost like the thing I wrote now
(But it's probably more efficient)
|
|
|
|
|
Hi all,
I have a name of a windows form in string type. I would like to generate it in runtime. How can I succeed this?
ex:
//my form class is MainPage let's say.
//I have :
string nameOfPage = "MainPage";
//I am searching a way of generating a form of type MainPage by just using variable nameOfPage
Thanks a lot!
|
|
|
|
|
Create an object of the form and set the name of the object as MainPage
Form newForm = new Form();
newForm.Name = "frmMainPage";
newForm.Size = new Size(200, 200);
newForm.Location = new Point(10, 10);
newForm.Show();
Oops I read your question wrong . You must be using what Colin said
Last modified: 11mins after originally posted --
|
|
|
|
|
IMHO this is not OP asks.
Perhaps he wants to dynamically create an instance of a class whose type is given by the "frmMainPage" string. Do you agree?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: Perhaps he wants to dynamically create an instance of a class whose type is given by the "frmMainPage" string. Do you agree?
Yeah, realized I read his question wrong
|
|
|
|
|
A form is just a class. You can use reflection to instantiate an object of a class if you know the name of the class.
See the MSDN documentation in the System.Reflection namespace.
|
|
|
|
|
OK --first post...;P
I have a windows app (simulation tool) that does a bunch of background number crunching. This is my first full C# project.
I want to stream some progress messages back to the user since the full simulation takes some time to run. (a la the messages that scroll by in a box during some software installation) The messagebox doesn't really do the trick.
Right now I am using a readonly textbox on the form and adding each message to the .Text property of the box, but this does not seem like the most efficient way. It usually doesn't actually display anything until it has all the messages --you just see the scroll bar changing in an empty box and then all the text appears, and when it's all said and done, there will be alot of messages and this seems like a lot of redrawing mostly the same thing...)
Basically, I want the equivalent of Console window Writeline messaging but delivered to a windows app something. It seems like there should be such a thing, but I can’t find it.
Thanks in advance.
-- modified at 12:49 Thursday 19th April, 2007
OK --so it turns out the property I was looking for was AppendText. I just didn't find that in any convenient documentation sources. It sounds like the Application.DoEvents() has some real memory use problems
|
|
|
|
|
The problem is that you're running your calculations on the UI thread. That will stop the update to the UI when you update the TextBox pretty quick.
The best solution is to move your long-running code to a background thread. A quick'n'dirty workaround is to call Application.DoEvents() every time you update that TextBox. But, there are pitfalls with using it if you don't manage the usable state of the controls your users can click on properly.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
In addition to the above, I suggest you use a ListBox rather than a TextBox
for displaying a growing collection of text strings; it is much more efficient
since it has no need for all the strings to be concatenated.
|
|
|
|
|
Hello All Gurus,
I have one client server application where I am sending files from client to server ,like file upload functionality , File could be any file eg .exe , .jpeg .
I am sending data in byte array through network stream /sockets.
File is tranfering correctly but when I am trying to open any .pdf or .jpeg file after transfer it is giving me error.cannot open file not in correct format.
Only txt file working correctly..
Please advise.
Regards ,
nishu
|
|
|
|
|
The file your saving on the server is, obviously, being corrupted. Either your client isn't sending the file byte-for-byte, or the server isn't receiving it properly, or it's not writing it byte-for-byte to disk. Without seeing anyn of your client and server code, it's impossible to tell you what's going wrong.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
It probably means the bytes are corrupted -- either you didn't get all the bytes or you didn't get them all in the right order. Do a file compare between original and transferred version to see if they're the same.
|
|
|
|
|
I'm wondering if the server is writing out a text file or a binary file? If the server is writing out a text file, that would explain this behaviour...
Phil
|
|
|
|
|
Yes it would. He's probably using TextReader/Writer, or some other text-only stream, probably even with an Encoding he specified, for reading/writing binary files. That'll corrupt 'em pretty quick.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Thanks for your reply...
I am not using TextReader/Writer ,I am using Filestream to write in the file....my code is as below,
stream = client.GetStream();
writer = new System.IO.StreamWriter(stream);
freader = new System.IO.FileStream(@"d:\AJAX_process.jpg", System.IO.FileMode.Open);
long length = freader.Length;
writer.WriteLine(length.ToString());
writer.Flush();
byte[] buffer = new byte[length];
freader.Read(buffer, 0,(Int32)length);
freader.Flush();
freader.Close();
//write buffer to network stream//
stream.Write(buffer, 0,(Int32)length);
stream.Flush();
stream.Close();
writer.Close();
One more question....
Do I need tto sent byte after byte....??
Regards ,
nishu
|
|
|
|
|
sorry I forgot to write but The above is sending data ....
stream=client.GetStream();
reader = new System.IO.StreamReader(stream);
filename = reader.ReadLine();
length = long.Parse(reader.ReadLine());
byte [] buffer = new byte[length];
stream.Read(buffer, 0,(int) length);
fwriter = new System.IO.FileStream(@"d:\new.jpg", System.IO.FileMode.CreateNew);
fwriter.Write(buffer, 0,(int) length);
MessageBox.Show("write to file done");
Regards ,
nishu
|
|
|
|
|
I want to enable a user to export a single MS Access Data Table from a multitable database into a separate database. More, I want the user to be able to create the separate database file at the same time he/she exports the datatable to that separate database file. I could simply use File.Copy to copy the entire database to the separate database file, but the users won't need the entire database, just the one table to allow them to archive certain information. Is this possible?
|
|
|
|
|
who can teach me to hacker ID games??
|
|
|
|
|
Noone around here will ever help you steal someone's software. Think about it. You just asked a bunch of developers, who making their living writing and selling software, how to steal the very software they're writing!
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
If I told you I'd be cutting my own throat!
|
|
|
|