I have Form1 and Form2 simultaneously active, Form2 has a TabControl and I want button click event on Form1 to change 'Enable' property of tabControl on Form2

TabControl on Form2 is set to `tabControl1.enabled = false;` and Form1 acts as a login form for Form2, so I need a Login button on Form1 to enable 'tabControl1' on Form2

I can access the property by setting `private System.Windows.Forms.TabControl tabControl1;` to 'Public', still, using the following on button click event on Form1 doesn't do anything.

```
Form2 formnew2 = new Form2();
formnew2.tabControl1.Enabled = true;

```

Can someone please provide a simple example to help me understand or link to a previously answered question
['https://Stackoverflow.com/questions/34459128', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2095012/']
`CGFloat` and `Float` are technically different types. The Swift programming language does not do any numeric type conversion / coercion. As such, you must explicitly convert from `Float` to `CGFloat` using one of the constructors on `CGFloat`.

```
colorView.backgroundColor = UIColor(red: CGFloat(redSlider.value), green: CGFloat(greenSlider.value), blue: CGFloat(blueSlider.value), alpha: 1.0)

```

You can read more about [Numeric Type Conversion](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html#//apple_ref/doc/uid/TP40014097-CH5-ID324) in [The Swift Programming Language](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/).
In my app using Swift 4, I am using this to convert Float to CGFloat:

```
let slider = sender as? UISlider
let val = CGFloat((slider?.value)!)

```

And then using the variable val as needed, which in my case is for hue, saturation and brightness, e.g.

```
coolButton.saturation = val

```