|
Call Invalidate() on the Control.
Charlie
if(!curlies){ return; }
|
|
|
|
|
The best way to force a repaint when you resize a Control or Form (which derives form Control ) is to override the Control and in the constructor (or some method that's called in the constructor) call SetStyle(ControlStyles.ResizeRedraw, true) .
At any time, though, you can call Control.Refresh to invalidate the entire control and force a repaint. If you only want to invalidate a certain section, first call Control.Invalidate and optionally pass the region you want to invalidate, then call Control.Update to repaint the invalidated regions. You can always just call Control.Update to repaint any regions that were invalidated by something else (like a form passing over it, in which case a WM_PAINT method is sent by Windows anyway).
-----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-----
|
|
|
|
|
Is it required to call Control.Update after calling Control.Invalidate ? I doubt. As I remember I would repaint my form just by calling Invalidate() method. Clear me if I am wrong, please!
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
No you're not entirely wrong, but if you don't call Control.Update to force it to repaint, your control won't be repainted until the next WM_PAINT message is sent, which you have no control over. Calling Control.Update repaints the invalidated region immediately.
-----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-----
|
|
|
|
|
Thanks everyone, I finish my .NET Control =P (My first).
And I used Invalidate(), works fine. And I used SetStyle, with the DobleBuffer to optimize my animations, I wanna write a article with my new animation control, Can i do??
----
hxxbin
|
|
|
|
|
Override ResizeRedraw to return true, paint as normal.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
hi
how can i set the startlocation of an winform?
i don't mean center or standard
i want to let it start bottom right of the screen, over the clock and tray icons
can someone tell me how i can do so
thx
|
|
|
|
|
Maybe you want a NotifyIcon??
----
hxxbin
|
|
|
|
|
hxxbin wrote:
Maybe you want a NotifyIcon??
i have one already
i need exacly what i wrote in the 1st post
|
|
|
|
|
Form.Location and set Startup position to manual.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
leppie's right about the positioning, but I must add that - according to the PSDK documentation - you can't display your form on top of the taskbar unless you use a borderless form and make it the size of the screen (a full-screen window), much like a screensaver.
-----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-----
|
|
|
|
|
Like I understand, you wanna a form that appear like the MSN messenger popup, why you don't check the code of one article named TaskbarNotifier here in CodeProject.
The author make a popup form over the taskbar like you need.
----
hxxbin
|
|
|
|
|
Hello everybody,
we are developping an asp.net apps ans we want to send an email, who will set, in outlook, a rendez-vous in the calendar of the user. How can we do this? We are using System.Web.Mail.MailMessage class to send the email.
Thanks for your answer.
Demmo
|
|
|
|
|
You'll need to look at the Office API references on http://msdn.microsoft.com[^] for exact details. You could also have such an email message get generated and open the meeting request in Outlook Express or another simple email reader to examine the content (SMTP headers, MIME headers, etc.). The latter would be reverse engineering so you can't be too sure about cases that aren't accounted for, so be sure to send many requests with different options. The best way, of course, is to find any documentation you can about this email type on MSDN.
-----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-----
|
|
|
|
|
Hi,
I've got a question regarding the treeview control on a C# windows form. How can I get the text of the selected treeview node? I know I need the .Text property to get the string, I just can't seem to get the selected/active treenode. I want to take part of that text and put it in a tool tip. I've got the tooltip part working but I'm getting the parent tree nodes text. The tree structure looks like this.
Last Name<br />
Smith<br />
Wallace<br />
<br />
First Name<br />
John<br />
William
Thanks
|
|
|
|
|
Manster wrote:
How can I get the text of the selected treeview node?
In away like this:
string str="";
if(treeview.SelectedNode!=null)
str = treeview.SelectedNode.Text
Mazy
No sig. available now.
|
|
|
|
|
Mazdak,
Thanks for your help. I'm actually trying to get the child node from the code you listed above. So if I'm currently getting "Last Name" returned to me now, I'm trying to get "Wallace" instead.
This is the tree structure.
Last Name
Wallace
A child node is selected and I need it's text. Is this possible?
This is the tree structure.
Thanks
|
|
|
|
|
SelectedNode has property named FirstNode which you go through it and get child nodes. It contains child nodes of selected node.
Mazy
No sig. available now.
|
|
|
|
|
Hi, i'm working with a datagrid and I want it to be updatable, but i dont want the last row ( insert row) to be available to the user, how would i proceed?
|
|
|
|
|
One way is set the AllowNew property of DataSet's DataView to false.
Mazy
No sig. available now.
|
|
|
|
|
I've written a window form that send files via a Socket using RSA encryption. I split the file up into peices for sending, I was wondering if there is a generally used buff size for sending over sockets. Right now i split each file up into 100 pieces unless a size is specified by the user. That was mostly for testing, so now I need to set a buffer size to use...any thoughts on the suject ? Whats too big for a socket connection, whats too small ?
|
|
|
|
|
Someone please correct me if I'm wrong, but I think it's like this.
Take a look at "MTU". It determines the maximum size of a single packet. In TCP, you don't really have to worry about losing anything, but I think it's more efficient to send it based upon the MTU size. Normal MTU for ethernet is 1500 bytes from what I understand.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Regards buddies,
While referencing a .DLL file in my project may I set it as an embedded resource so only one executable assemply be my result?
Thanx
---
"Art happens when you least expect it."
|
|
|
|
|
Yes you could do it.
But then how are you planning to get the types from the embedded assembly ???
Right, using Reflection...
Free your mind...
|
|
|
|
|
You mean at runtime? .NET framework doesn't provide ability to load types from the embeded assembly at runtime in some way? (I don't mean using Reflection API which requires developer to code, some automatic reference to inside assembly as if it was an external .dll)
Would you give more describtive explanation?
---
"Art happens when you least expect it."
|
|
|
|