|
I think this may be what you want:
http://vbaccelerator.com/home/NET/Code/Libraries/Windows/MDI_Client_Area_Painting/article.asp
I bet you never guessed it was going to be this hard. I sure didn't.
|
|
|
|
|
Holy cow!
What a lot of code! No, I certainly didn't expect it to be that hard. Thanks for the answer, though. Now I need to write some letters to MS to figure out why you need to go to such trouble to add an image to an MDI client
Agent 86
|
|
|
|
|
using System;
namespace afs
{
class Class1
{
string asdf;
[STAThread]
static void Main(string[] args)
{
asdf="USER ";
}
}
}
OH MY GOD. Have I gone nuts or something??? WHat that hell! Why won't this compile?
/\ |_ E X E GG
|
|
|
|
|
You can not access a instance field
from a static function. You will need
a object referance just like the compiler
tells you when you try to compile it.
Thank You
Bo Hunter
|
|
|
|
|
Complier didn't say anything... I now realize what I did though.
/\ |_ E X E GG
|
|
|
|
|
Because you declared asdf as an instance field and are trying to assign it from a static method without even instantiating Class1 yet. Try adding static before string asdf; .
The compiler error actually should've made this clear.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Complier didn't say anything... I now realize what I did though.
/\ |_ E X E GG
|
|
|
|
|
Mine said, "An object reference is required for the nonstatic field, method, or property 'WindowsApplication1.Form1.asdf'", both in VS.NET 2002, 2003, and the command-line compiler csc.exe (which VS.NET uses).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I swear, it wasn't saying anything... I tried VS and the csc.exe also... However, it seems after I restared... everything is back to normal and the complier is giving me
"An object reference is required for the nonstatic field, method, or property 'WindowsApplication1.Form1.asdf'"
So, I guess that's good. Oh well, whatever.
/\ |_ E X E GG
|
|
|
|
|
I need same help if you could help me!I have to windows aplications one is the Client and the other is the server but i can't change information between them, now i'm using sockets, if sameone could help-me!:].
i don't know if is possibel this way, right now i don't know the right direction for my application, what i want is:
One server that receives a msg from a client application testBox into a label that is in the server
Mario Santos
|
|
|
|
|
|
Object-based collections may be fine for reference types, but I'm looking for a high-performance collection to store only value types without the boxing/unboxing overhead. Is there anything available to me in the .Net BCL? Or anything on this site that might help me? (already did a search, but might've missed something)
The graveyards are filled with indispensible men.
|
|
|
|
|
Not in the BCL, not until .NET 2.0 when they will be introducing generics in .NET.
For now, you can implement something yourself. Almost all collection-like classes in .NET use an ArrayList because it can grow but it does take an Object which requires boxing value types. ArrayList uses arrays internally, and creates new arrays when necessary and copies elements to the new array. Do the same yourself, but using the value types that you need to collect. Methods like Array.CopyTo make copying elements to the new array easy, and of course creating a new array that's large enough isn't hard. For example, ArrayList.Capacity is the initial capacity (size of the array). When more elements need to be stored, Capacity is doubled and a new array of that size is created. Elements are copied and the old array is disposed (if necessary). You wouldn't have to double, though, it just what the BCL does. You could implement more predictive algorithms if you need to.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
As always, Heath, your answers are very informative and helpful, thanks. I'll see if I can throw together a home-rolled solution then.
The graveyards are filled with indispensible men.
|
|
|
|
|
i want to respond to keyboard event while the window of my project is inactive
thanks
|
|
|
|
|
|
Actually, this is conditional...
If you mean your entire application is not the active Window, then using a system hook is best.
If you mean that a dialog in your application has lot focus, but your application still has focus, then you should use an IMessageFilter and register it with Application.AddMessageFilter .
Using system hooks slows down the speed of the entire window manager because your program has to filter and process the necessary data. If you don't NEED to, don't do it.
Also, if you do use a system hook, make sure you unregister it before exiting your application, like in your main window's (i.e., the Form that was run with Application.Run ) Close event handler, or better yet in the Dispose override, or before youe application's entry point (i.e., Main ) exits.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
|
Has someone print in .Net a custom papersize?. I have tried, and the only size that print is the standard size, 8.5" x 11". What do I need to do to change the papersize?
Carlos Eduardo Hernandez P.
|
|
|
|
|
I don't know how to change it. But, was this not answered in the last 24 hours? Click "Search comments" above, i'm pretty sure your answer is there. Good Luck.
/\ |_ E X E GG
|
|
|
|
|
it dindnt. I am just trying to open a new thread so other people can comment on this. It has not work yet.
Carlos Eduardo Hernandez P.
|
|
|
|
|
alright... I put "paper size" in there and found a bunch of stuff...
/\ |_ E X E GG
|
|
|
|
|
|
- Do not keep posting the same question - we do not like that here and if you didn't get answers the first 1000 times, you probably won't get one at all (but might find more spam in your inbox!)
- What I gave you should work (the link that Mazdak sent you). If it doesn't, you need to reply to that thread and - as I stated in the message - research the problem instead of just guessing and asking other people!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Sorry. But I have research enough, and it is not in the .net help, it is, but it doesnt work. Your example and Mazdak'a didnt work also. Maybe you should try what you post. When I help someone in a problem, I tried to help them completly not half way. Thanks.
Carlos Eduardo Hernandez P.
|
|
|
|