Click here to Skip to main content
16,011,120 members
Home / Discussions / C#
   

C#

 
GeneralRe: make a control be not confined within its parent windows Pin
Heath Stewart4-Dec-03 19:06
protectorHeath Stewart4-Dec-03 19:06 
GeneralRe: make a control be not confined within its parent windows Pin
honasho4-Dec-03 19:15
honasho4-Dec-03 19:15 
GeneralQuestion about inheriting from TreeNode Pin
DoofToo4-Dec-03 13:10
DoofToo4-Dec-03 13:10 
GeneralRe: Question about inheriting from TreeNode Pin
Heath Stewart4-Dec-03 14:39
protectorHeath Stewart4-Dec-03 14:39 
GeneralRe: Question about inheriting from TreeNode Pin
DoofToo4-Dec-03 15:11
DoofToo4-Dec-03 15:11 
GeneralRe: Question about inheriting from TreeNode Pin
J. Dunlap4-Dec-03 15:56
J. Dunlap4-Dec-03 15:56 
GeneralRe: Question about inheriting from TreeNode Pin
DoofToo4-Dec-03 16:26
DoofToo4-Dec-03 16:26 
GeneralRe: Question about inheriting from TreeNode Pin
Heath Stewart4-Dec-03 18:46
protectorHeath Stewart4-Dec-03 18:46 
I was about to tell you to cast. It's an important concept to understand when dealing with polymorphism.

There is actually a better way, though:
propertyGrid.SelectedObject = ((TreeNodePtr)e.Node).SkinObject;
It's better because the as keyword acts as a cast that - if the cast is not successful - only returns null instead of throwing an InvalidCastException. This is better because it requires fewer instructions to perform and doesn't use a try-catch, which can be very expensive! Fortunately, even if the original TreeNode was not a TreeNodePtr, casting it will make it one so that an exception will not be thrown - SkinObject will be null, though, which will just reset the PropertyGrid. Either way, a simple cast is faster and will perform better.

 

-----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-----
GeneralRe: Question about inheriting from TreeNode Pin
DoofToo8-Dec-03 6:27
DoofToo8-Dec-03 6:27 
GeneralRe: Question about inheriting from TreeNode Pin
Heath Stewart8-Dec-03 6:34
protectorHeath Stewart8-Dec-03 6:34 
GeneralRe: Question about inheriting from TreeNode Pin
DoofToo8-Dec-03 10:31
DoofToo8-Dec-03 10:31 
GeneralTextBox Alignment Pin
Shaun Becker4-Dec-03 13:00
Shaun Becker4-Dec-03 13:00 
GeneralRe: TextBox Alignment Pin
Heath Stewart4-Dec-03 14:30
protectorHeath Stewart4-Dec-03 14:30 
GeneralRe: TextBox Alignment Pin
Shaun Becker5-Dec-03 1:46
Shaun Becker5-Dec-03 1:46 
QuestionAnyway to tell the IDE Designer not to manage a control? Pin
DoofToo4-Dec-03 12:51
DoofToo4-Dec-03 12:51 
AnswerRe: Anyway to tell the IDE Designer not to manage a control? Pin
Heath Stewart4-Dec-03 13:57
protectorHeath Stewart4-Dec-03 13:57 
GeneralWeb Setup Project, setup.exe check current installed version before downloading... Pin
Chris Richner4-Dec-03 12:44
Chris Richner4-Dec-03 12:44 
GeneralRe: Web Setup Project, setup.exe check current installed version before downloading... Pin
Heath Stewart4-Dec-03 13:53
protectorHeath Stewart4-Dec-03 13:53 
QuestionListView (View=List) with Vertical Scroll ? Pin
pahluwalia4-Dec-03 9:10
pahluwalia4-Dec-03 9:10 
AnswerRe: ListView (View=List) with Vertical Scroll ? Pin
Heath Stewart4-Dec-03 9:45
protectorHeath Stewart4-Dec-03 9:45 
Generallaunch file viewer from c# program Pin
elena123454-Dec-03 9:03
elena123454-Dec-03 9:03 
GeneralRe: launch file viewer from c# program Pin
Heath Stewart4-Dec-03 9:40
protectorHeath Stewart4-Dec-03 9:40 
QuestionA way to control graphic card driver? Pin
Radoslav Bielik4-Dec-03 8:29
Radoslav Bielik4-Dec-03 8:29 
AnswerRe: A way to control graphic card driver? Pin
Daniel Turini4-Dec-03 8:53
Daniel Turini4-Dec-03 8:53 
GeneralRe: A way to control graphic card driver? Pin
Radoslav Bielik4-Dec-03 9:19
Radoslav Bielik4-Dec-03 9:19 

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.