|
Yes, if you are using ShowDialog, before you call that you would have to either call Hide() or visible=false which will cause a little flicker.
I did not bother trying the member refresh since I thought it might delay the refresh of the controls but it does the same.
If you initialization code is very long you could also just have one control that you refresh (only one that would show) that would have a message like "one moment please", which would inform your using that something is happening so that even if they do see your form they will not try to access it until your initalization is over. Once your initailization is over, you can hide that one control and do your Hide and ShowDialog.
Rocky Moore <><
|
|
|
|
|
Use CreateHandle() instead of Show(), but is still feels like a hack to me too.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
I find this very odd.
this.Controls.Add(this.splitter2);
this.Controls.Add(this.panel1);
this.Controls.Add(this.splitter1);
this.Controls.Add(this.treeView1);
The controls are added in reverse order. The tree view is the leftmost pane, then splitter1, then a panel, then splitter2 (from left to right), yet they are added in reverse order.
Why?
BTW, if I add them in left to right order, they appear right to left, so order is important. Is this the way it works in general, or an artifact of using splitters, or having to do with the ControlCollection base?
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
So VS .NET doesn't use this.Controls.AddRange() ?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Oh, that's another odd thing. It usually does. But not when adding splitters. Of course, I may have confused it because I was adding splitters in the wrong way and had several on the form and then had to delete them.
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
The order controls are added determines the Z-Order (assuming no calls to SendToBack or BringToFront are made). Docking and the splitter control both rely on z-order to determine how they work when multiple items are set to dock on the same side. Controls at the back of the z-order (those added last) are given priority over docking positions.
Regarding Controls.Add vs Controls.AddRange:
In VS.NET 2003 a change was made so that the code generator uses this.Controls.Add instead of this.Controls.AddRange . IIRC the MS folks said the change was made so that if an added control decides to crap-out the rest of the form is still ok.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
Thanks! Yes, I read about the Z-ordering, but I was assuming something different in how the z-order applied.
Gads, this is counter-intuitive, and makes dynamic GUI generation complicated, because I'd like to automatically determine this from a sequence of controls so I don't have to think about it. I would prefer that the controls were added left-to-right (or top-to-bottom) in the same way that they appear. This is more intuitive, I feel. Of course, if the controls are docked to the right (or bottom), then it would be left-to-right, wouldn't it? Time to fiddle with things in the designer, I guess.
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
AnchorStyles
and
DockStyle
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
...and you find these stupid why?
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Because they both deal with a similar concept, yet one enumeration is in its plural form, and the other enumeration is in its singular form. Consistency would have been nice.
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
stringbuilder.AppendFormat("{0,-10}", mn.Substring(3), j++);
Note the j
<a TITLE="See my user info" href=http:
|
|
|
|
|
AnchorStyles is plural because you can set multiple styles at once, where-as with DockStyle only one may be applied at a time.
Who knows if that's the real reason, but I do similar things with my code
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
OK, you get a 5 for a reasonable sounding explanation.
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
So how does the .NET framework do as far as compound documents? I'm guessing you're probably just supposed to write your own interface defs for all the compound document interfaces yourself, and then use those.
Also, is Isolated Storage the .NET equiv of IStorage?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
I don't know enough about your first question to answer it...
jdunlap wrote:
is Isolated Storage the .NET equiv of IStorage?
Isolated Storage is a 'safe' storage mechanism that is meant more for HTTP deployed applications than anything else. I say this for three reasons: 1) you can use Isolated Storage event when running under the Internet permission set (assuming Internet isn't set to Nothing), 2) IIRC the default limit on what can be stored is 10KB and 3) there is no easy way for the user to see what is in isolated storage.
There is supposed to be some utility that you can run which will let you see the contents of Isolated Storage, but you can't expect your end-user to know about that utility.
This is really bad in a situation where the end-user is getting a new computer and wants to move your program to the new PC. How will they find your files (first they probably don't even know Isolated Storage exists), but if they do they just see a series of directories with very weird names.
Until MS makes an explorer work with Isolated Storage like they did for the GAC, I have a hard-time agreeing with people who want to use Isolated Storage to store settings or anything of critical nature.
Well that got off-topic didn't it
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
Thanks for the info. I suppose I'll use the OLE storage implementation.
I'm well versed in OLE document technology, including structured storage, so that shouldn't be too hard.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Something that just hit me, are you trying to read/write existing files/file formats or something brand new?
If the latter then serialization is one step in the same direction. You can either let the framework handle all of the details (simply apply the Serializable attribute to the class/struct) or you can customize it by also implementing ISerializable .
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
For my current project, I am going to use XML. But I want my documents to be able to be embedded in OLE documents, not just linked.
I really like the idea of serialization, and have tried it out. (Just think - persist your whole class and let .NET do the work (except for the attributes on the members)!) But can a legacy OLE document use it like IPersistStorage? (They'd be smart to do it this way, and it wouldn't be too hard.)
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
We have a Windows Service written in C# that simply host some remote
components. The service does nothing itself. We have an ASP.NET application
that initialises the remoting in global.asax and has a single aspx page that
creates the remote component and calls its method, which returns a small
string. Thing is that the service process leaks memory. Now I've read most
of the articles/books on the wonders of the GC and I know that what I'm
seeing is not normal behavour. And here the catch: if I run the application
as a standard process, i.e. I replace the call to ServiceBase.Run with a
long Sleep statement - the application does not leak memory. The CLR memory
performance counters show very different traces of #bytes on heaps running
the same test. What could be causing this behaviour? Could anyone from
Microsoft check to see if remoting components from a Service has memory
issues. In the ASP.NET page I simply release the object by setting the
reference to null. My tests run for several hours with several hour of low
and high load but the service never reduces it memory. The process version
remains very flat. I'm not using any unmanaged resources or any thing that
consumes loads of memory just small string (100 characters or so).
|
|
|
|
|
Do the remoting components make use of any unmanaged resources / should or do you implement the IDispose interface?
|
|
|
|
|
Is anyone doing much work with Graphics.DrawImage? It does an adequate job for small images, but if you start getting into large ( 5 meg + ) images it really sucks. It also does not appear to be any faster if you limit the size of the image that is actually being drawn (drawing only a small portion of it).
DrawImage appears to limit .NET's unusability for anything similar to the complex and efficient drawing capabilities available with the various bitblting techniques in Win32 (which I know are available in .NET with a little extra work, but you no longer get the Transform methodlogy etc. available with GDI+ under .NET, which is nice to have). I'm also aware of various image cacheing techniques which speed up DrawImage - but for large images they simply require too much memory to be practical.
|
|
|
|
|
All of the rendering capabilities in .NET are performed by GDI+ (1.0 at the moment). GDI+ 1.0 has zero support for hardware accelleration, from my understanding. I beleive that GDI+ 1.1 will have support for hardware accelleration (assuming your video card has the appropriate new drivers).
I, too, have noticed this nasty surprise. You can tweak the Graphics object to use lowest quality rendering, and you can use DrawImageUnscaled to try and speed things up a bit, but I don't think it will be an order of magnitude faster than it is currently, and it certainly wouldn't compare to real hardware accelleration of the blitting/stretching.
--
Russell Morris
"Have you gone mad Frink? Put down that science pole!"
|
|
|
|
|
hi,
does anyone know when the gdi+ v1.1 is shipped? even the dll-version for c++?
thx
michael
|
|
|
|
|
Hi all,
i've developed a c# windows application that envolves file I/O. Up to now all development has been on my own machine running win2k pro and i am logged in as an administrator. I recently tried running the code on another machine on which i installed the .net redistributable and as soon as the app tried to access the file system (i.e when opening a file dialog) it through an exception of the type System.Security.FileIOPermissions.
I've looked into it a bit and discovered how the clr assigns permissions to different assemblies at runtime etc.
What i'd like to know is, is there a way for me to configure my code so that it can always access the file system on other machines... i don't want the user to have to manually increase the trust level using the .net config tool as that would be very messy!!
any help is appreciated
Thanks
Paul
Paul Griffin
|
|
|
|
|
It seems that the .NET LicenseProvider does not work if the user is not allowed to modify the executing assembly, for instance, if the licensed control is consumed in an ASP.NET web application.
What are the possible workarounds?
|
|
|
|