单项选择题
You are creating a Windows Forms application by using the .NET Framework 3.5. You plan to develop a new control for the application.You need to ensure that the control extends the TreeView control by adding a custom node tag and a highlight color.What should you do?()
A.Override the OnPaint method.
B.Write a code segment in the DrawNode event handler to specify the highlight color.
C.Set the DrawMode property of the control to OwnerDrawAll, and then implement a custom DrawNode event handler.
D.Set the DrawMode property of the control to OwnerDrawText,and then implement a custom DrawNode event handler.
相关考题
-
单项选择题
YouarecreatingaWindowsFormsapplicationbyusingthe.NETFramework3.5.Youplantodevelopacustomcontrolfortheapplication.Thecontrolwillbeacompositecontrol.Yourneedtoderivefromtheclassthatwillcreatethecontrolbyusingtheminimumamountofdevelopmenteffort.Whatshouldyoudo?()
A.Derive from the Control class.
B.Derive from the UserControl class.
C.Derive from the FrameworkElement class.
D.Derive from the ContainerControl class. -
单项选择题
YouarecreatingaWindowsFormsapplicationbyusingthe.NETFramework3.5.Youplantodevelopanewcontrolfortheapplication.YouneedtoensurethatthecontrolextendstheDataGridViewcontrolbyallowingthecellstocontainmulticoloredtext.Whatshouldyoudo?()
A.Override the OnPaint method.
B.Write a code segment to handle the CellPainting event.
C.Write a code segment to handle the CellParsing event.
D.Write a code segment to handle the RowPostPaint event. -
单项选择题
YouarecreatingaWindowsFormsapplicationbyusingthe.NETFramework3.5.Youplantodevelopanewcontrolfortheapplication.ThecontrolwillhavethesamepropertiesasaTextBoxcontrol.Youneedtoensurethatthecontrolhasatransparentbackgroundwhenitispaintedonform.Youwanttoachievethisgoalbyusingtheminimumamountofdevelopmenteffort.Whatshouldyoudo?()
A.Create a new class that is derived from the Control class.Call the SetStyle method in the constructor.
B.Create a new class that is derived from theTextBox control class.Override the OnPaint method in the constructor.
C.Create a new class that is derived from the Control class.Set the BackColor property of the control to Transparent.Call the SetStyle method in the constructor.
D.Create a new class that is derived from theTextBox control class.Set the BackColor property of the control to Transparent in the constructor.Call the SetStyle method in the constructor.
