Add User Properties to Controls

Add User Properties to Controls

To add user-defined properties to controls, use this code to store them in the control’s tag. You can define multiple additional properties at design or run time. You can easily retrieve the value stored:

 Control.Tag = AddParam((Control.Tag), _	"tooltip", "Close this window.")Control.Tag = AddParam((Control.Tag), "user", "True")Tooltip = GetParam((Control.Tag), "tooltip")Function AddParam (Text As String, _	Param As String, Value) As StringDim Text1 As StringIf Not IsNull(GetParam(Text, Param)) Then	Text1 = DelParam(Text, Param)Else	Text1 = TextEnd IfIf Text1 <> "" Then	Text1 = Text1 & ";"End IfAddParam = Text1 & Param & "=" & (Value)End FunctionFunction DelParam (Text As String, _	Param As String) As StringDim i As IntegerDim j As IntegerDim s1 As StringDim s2 As StringDim Text1 As StringText1 = Texti = InStr(UCase(Text), UCase(Param) & "=")If i > 0 Then	If i = 1 Then		s1 = ""	Else		s1 = Left(Text, i - 2)	End If	j = InStr(i, Text, ";")	If j > 0 Then		s2 = Mid(Text, j + 1)	Else		s2 = ""	End If	If s1 = "" Or s2 = "" Then		Text1 = s1 & s2	Else		Text1 = s1 & ";" & s2	End IfEnd IfDelParam = Text1End FunctionFunction GetParam (Text, Param)Dim i As IntegerDim j As IntegerDim Text1 As StringIf Len(Text) Then	If Left(Text, 1) <> "'" Then		Text1 = ";" & Text & ";"		i = InStr(LCase(Text1), ";" _			& LCase(Param) & "=")  + 1		If i > 1 Then			j = InStr(i + Len(Param), Text1, ";")			GetParam = Mid(Text1, i + Len(Param) + 1, _				j - i - Len(Param) - 1)		Else			GetParam = Null		End If	Else		GetParam = Null	End IfElse	GetParam = NullEnd IfEnd Function
Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes