We help IT Professionals succeed at work.
Get Started

Optional Parameter generates error if color is a parameter

956 Views
Last Modified: 2013-12-17
When I am using the folllowing line as input parameter of my function

"Optional ByVal InColor As Color = SystemColors.Control" it is giving error as "optional parameter can not have structure type".

Then How to use color as input parameter of a function?
Private Function fShowControl(ByRef InTreeGridViewName As TreeGridView, ByVal InRowNo As Integer, ByVal InColNo As Integer, _
                                  ByVal InControl As MYCONTROLS, Optional ByVal InShowMsg As Boolean = True, _
                                  Optional ByVal InHorizontalPadding As Integer = 1, _
                                  Optional ByVal InVerticalPadding As Integer = 1, _
                                  Optional ByVal InCaption As String = "", Optional ByVal InColor As Color = SystemColors.Control) As Boolean
 
 
 
'XXXXX
 
 
 
End Function

Open in new window

Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE