Click here to Skip to main content
16,004,859 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Adding Dropdown button to ToolStrip Pin
εїзεїзεїз17-Sep-09 23:40
εїзεїзεїз17-Sep-09 23:40 
QuestionUsing Reflection to access functionality from a web-hosted library. Pin
ccdsystems15-Sep-09 13:33
ccdsystems15-Sep-09 13:33 
AnswerRe: Using Reflection to access functionality from a web-hosted library. Pin
Dave Kreskowiak16-Sep-09 5:17
mveDave Kreskowiak16-Sep-09 5:17 
GeneralRe: Using Reflection to access functionality from a web-hosted library. Pin
ccdsystems16-Sep-09 7:44
ccdsystems16-Sep-09 7:44 
QuestionRetaining Drawn Graphics Pin
farzadmf15-Sep-09 12:23
farzadmf15-Sep-09 12:23 
AnswerRe: Retaining Drawn Graphics Pin
Luc Pattyn15-Sep-09 14:57
sitebuilderLuc Pattyn15-Sep-09 14:57 
QuestionRe: Retaining Drawn Graphics Pin
farzadmf16-Sep-09 0:23
farzadmf16-Sep-09 0:23 
AnswerRe: Retaining Drawn Graphics Pin
Luc Pattyn16-Sep-09 1:52
sitebuilderLuc Pattyn16-Sep-09 1:52 
Hi,

farzadmf wrote:
1. Why do you find the PictureBox control a useless one?


Because its functionality is very limited, and as soon as you need more, it works against you. It is OK for showing a picture, it is not OK for modifying a picture, for showing some graphics, for animation, for ...


farzadmf wrote:
2. Why did you say that we shouldn't call the CreateGraphics method?


Because a Graphics object is expensive; you get one for free in the Paint method, other ways of painting require you to create one explicitly (and disposing of it).


farzadmf wrote:
3. What exactly does the Panel.Invalidate() method do and how it can be used here?


it tells Windows your control has changed somehow and need a full or partial repaint; so Windows will call your paint handler asyncrhonously to fix that. All this and the details can be found in the documentation.


farzadmf wrote:
4. Why did you say that either create the pen, font, etc. object as class members or create them inside the Paint event handler and call the Dispose method? Why is the Dispose method necessary here and what's the difference between these two methods you mentioned.


That is elementary:
a. you must call Dispose on all instances you created and no longer need from classes that that offer a Dispose() method.
b. so you either create and dispose such objects every time you rpaint handler gets executed (that will take a lot of unnecessary CPU cycles); or you create them once and keep them around.


May I suggest you improve your programming knowledge by reading a lot, starting with an introductory book[^]to the language of your choice; and learn to use Google to find information you may need.

Smile | :)

Luc Pattyn

Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.

Local announcement (Antwerp region): Lange Wapper? Neen!


GeneralRe: Retaining Drawn Graphics Pin
farzadmf16-Sep-09 12:50
farzadmf16-Sep-09 12:50 
Questionwindows service not working Pin
iiiii15-Sep-09 0:00
iiiii15-Sep-09 0:00 
AnswerRe: windows service not working Pin
Dave Kreskowiak16-Sep-09 5:10
mveDave Kreskowiak16-Sep-09 5:10 
GeneralRe: windows service not working Pin
iiiii16-Sep-09 18:47
iiiii16-Sep-09 18:47 
GeneralRe: windows service not working Pin
Dave Kreskowiak17-Sep-09 1:10
mveDave Kreskowiak17-Sep-09 1:10 
QuestionUrgent : How to improve performence ?? Pin
Tejaswini Prashant J14-Sep-09 20:11
Tejaswini Prashant J14-Sep-09 20:11 
AnswerRe: Urgent : How to improve performence ?? Pin
Luc Pattyn15-Sep-09 15:01
sitebuilderLuc Pattyn15-Sep-09 15:01 
AnswerRe: Urgent : How to improve performence ?? Pin
Eddy Vluggen16-Sep-09 4:34
professionalEddy Vluggen16-Sep-09 4:34 
QuestionUpdating PictureBox control every one minute in windows form Pin
Member 418166914-Sep-09 6:29
Member 418166914-Sep-09 6:29 
AnswerRe: Updating PictureBox control every one minute in windows form Pin
Richard MacCutchan14-Sep-09 8:56
mveRichard MacCutchan14-Sep-09 8:56 
GeneralRe: Updating PictureBox control every one minute in windows form Pin
Luc Pattyn15-Sep-09 15:02
sitebuilderLuc Pattyn15-Sep-09 15:02 
QuestionCan i change the shape of the button as its background image? Pin
CoderForEver13-Sep-09 1:10
CoderForEver13-Sep-09 1:10 
AnswerRe: Can i change the shape of the button as its background image? Pin
dan!sh 13-Sep-09 1:26
professional dan!sh 13-Sep-09 1:26 
GeneralRe: Can i change the shape of the button as its background image? Pin
CoderForEver14-Sep-09 22:06
CoderForEver14-Sep-09 22:06 
GeneralRe: Can i change the shape of the button as its background image? Pin
Henry Minute16-Sep-09 2:41
Henry Minute16-Sep-09 2:41 
GeneralRe: Can i change the shape of the button as its background image? Pin
Richard MacCutchan17-Sep-09 4:41
mveRichard MacCutchan17-Sep-09 4:41 
QuestionOverride Text property in GroupBox Pin
dybs11-Sep-09 19:05
dybs11-Sep-09 19:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.