|
Yes, I have done it like this.
Maybe there is a certain function in .NET that makes the same , but in an easier way.
Something like:
BeginUpdate();
.... some code here ...
EndUpdate();
Between these 2 tags the controls are not repainted.
Now I have made it through message filtering, i.e. I have a variable , which when set TRUE, paint messages are not allowed to be dispatched to controls contained in the form.
Works well.
|
|
|
|
|
SuspendLayout();
... do your control moving, etc
ResumeLayout();
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
SuspendLayout is a bullshit.
It doesn't work as it should. It do blocks some of the controls repainting, but allows others.
I have tried it many times - and it never worked as expected.
|
|
|
|
|
Heh, fair enough.. it's worked exactly as I wanted in the places I've used it, anyway
Are you using custom controls? Perhaps those aren't too well designed for C# usage, or something
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
Actually I use standart controls in a usercontrol.
And this usercontrol is placed on a form.
Anyway - I read somewhere that SuspendLayout works only a few of the controls, because many of them has their own way of painting.
With standart controls, probably like buttons, labels - it may work.
With textboxes it doesn't work for sure (as it's controled by Windows).
|
|
|
|
|
I need to serialize object of my class. I derives from a class which is not serializable. The questions:
1) Do I have to implement the ISerializable interfaace in my class?
2) Are enums serializable?? I have several enum fields in my class.
Thanks!
|
|
|
|
|
#1 Just put the serializable attribute atop your class
#2 Yes they are and will be automatically, if used in your serializable class
the class you are deriving from not being serializable should not be a problem unless the class does some stuff that almost deliberlately makes it nonserializable. Give it a try, it should work flawlessly. Use the .NET serialization routines to save and restore your class, you'll find it works quite easily.
Use the .NET Binary serializer in your main code to save/restore these class objects.
|
|
|
|
|
#1 Just put the serializable attribute atop your class
That won't work if the class he's extending is not serializable. From the MSDN[^]: "It is important to note that the Serializable attribute cannot be inherited. If you derive a new class from MyObject, the new class must be marked with the attribute as well, or it cannot be serialized. For example, when you attempt to serialize an instance of the class below, you will get a SerializationException informing you that the MyStuff type is not marked as serializable".
The only way around it is to use ISerializable
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
hi
how i can load and display bitmap files in c#?
tanx®ards
|
|
|
|
|
PictureBox pic = new PictureBox();<br />
Bitmab b = new Bitmap(@"Your path here");<br />
pic.Image = p;
|
|
|
|
|
Hello gurus,
I would like to know, how I can add a browse for file or folders button in a PropertyGrid control?
Thanks for giving me a clue.
Best regards.
There is no spoon.
|
|
|
|
|
Hey everyone!
I want to create a dialog window (SDI...) that will connect to the net to a certain address I'm writing inside my code. (so no one can change the address, only browse from the page they're getting).
Thanks!!!
|
|
|
|
|
I take it there is a question in this post somewhere? What exactly are you having a problem with?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
the thing is that I want to open the dialog window and it will directly connect me to a specific address (like http://www.codeproject.com).
I don't have any specific question because I don't know exactly how to approch this problem.
I looked in the board for an answer, for any kind of code that might help me with this, but I couldn't really find one.
|
|
|
|
|
All you need to do is drop a web browser control on the form and use it's Navigate method with the address you want.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks!
I already have done that (after my last post), and I wrote another post about it.
the thing is that everything works fine as long as I don't use the Navigate method (and thats kinda useless), but when I'm tryint to use the Navigate method I'm getting: "InvalidActiveXStateException" exception.
I really don't understand why, I checked the web for an answer but I didn't find anything that really works.
now I'm lost !
|
|
|
|
|
okay, solved it!
thanks!!!
and just for all of you out there who encounters the same problem,
the Navigate method has to occure only AFTER the form has been completly loaded, thats why we cannot use it in the constractor.
to make the Home page start downloading right after you open the window just use the Navigate method in the FrmMain_Load event function ("Load" event of the form).
|
|
|
|
|
hi all,
I want to know how i can prevent the user to delete folder or some folder used C# language
thanks
|
|
|
|
|
Unless you want to write a file system extension, you can't.
The best way to do it is assign the appropraite NTFS permissions to the security tab in the folder properties.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I've been working on a problem whereby i'm trying to write an System.Drawing.Image object to an SQL Server database and then reload them from the database back into an System.Drawing.Image object but have come up aginst many brick walls.
I want to try a fresh approach so i need ideas as to how this could be achieved. I'm asking for solutions as I've already asked alot of other people for help on my current way of doing things and they have all been puzzled by the problem.
Thanks
Dafydd
|
|
|
|
|
Hi Everyone,
Again I am posting my probs in this message board.
I want to make a program in which multiple "same" taskbarnotifier(Image) appears at same time looks like MSN messager. When multiple user login on MSN Messager at a same time a pop window(Image) appears right hand side(On the window Screen) "one by one".
I have already created multiple different Image.
When I use two or more different image, it pop up right hand side of window screen one by one, but not the case with same image, it only shows one.
Can you help me out.
Thanks
|
|
|
|
|
Hi,
I'm trying to find a way to connect my c# application to an embedded
webbrowser control in a "finished" application from another company (where I
don't have a chance to modify the source)...
Is there a possibility to connect to the webbrowser control inside this application?
(for example to get the HTML Source of the control?)?
Thanks in advance, Randy
|
|
|
|
|
We have a legacy data struct - in C - basically a two-dimensional set of data accessible thru a C API - much like a DataTable. We want to show this data in a DataGrid and in other related controls. We're looking for a way to write our own C# wrapper class to hold the C struct, and implement the necessary interfaces so that it can be uses with the DataGrid via binding. First of all, does this approach make sense? And if it does, what interface should we implement? I've been looking at IList, but can't quite figure out how the IList interface deals with the 2-dimensional nature of our data.
If anyone chooses to email me directly, remove the x's from the email address first (trying to foil the spambots).
Rich
|
|
|
|
|
I would suggest that you programatically create a DataTable object, stuff it with the data to be displayed and simply point the datagrid at it (set its datasource property). If I understand your problem correctly then I believe this is the most simple way to achieve your goal. I assume that you are wanting to display the data in a datagrid as rows and columns, 2 dimensional?
Is there any reason you can't use a Datatable object as you mentioned in your question?
|
|
|
|
|
Thanks for the quick reply.
I should have mentioned that our data can be VERY large - 100,000+ rows. Obviously we wouldn't want to copy all of that data over to a Datatable before displaying it, plus the duplication of all of that memory. That's why I thought if we could implement a set of interface methods that access the data from our own source, it might be a reasonable approach.
|
|
|
|