I am trying to set the backcolor to a control. The user provides the name of the control in a TextBox. How is this done?
Dim nameofctrl As Object = Textbox1.text
DirectCast(nameofctrl, Control).BackColor = Color.Green
Well to be honest, I'm not using 'sender', I'm using 'lastSender', which is the saved sender of a sub that handles all the .clicks of the ts buttons. I can then see if the lastSender.CheckState is checked and then add the control to the form.
Thanks though! DirectCast works great!
I have a large case select that I want to simplify. Inside the select I'm creating controls base of which ToolStripButton is checked.
Select Case strCtrl
If btnCTRLSText.CheckState = CheckState.Checked Then
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button1.BackColor = Button1.BackColor
There was no point to the .red, it was simply there to show the color had to change for another reason which isn't...
I am trying to figure out how to decifer the .name, .tag, etc of a control that sent the user to a subroutine.
I know its something to the extent of
That ofcourse does not work, but an example I had and lost I think described the solution that way. Any suggestions?
Sorry guys, my problem is not that control are being added to the wrong form, it is that since many tasks are done multiple time I want it to be handled in one sub. It's not going to be as effective as I thought though since I was having each controls .Text, .Name, etc set this way. But it...
I have a a series of buttons that are handled by one subroutine. Once one of the buttons is pressed I want to create a new control on the form of whatever button was pressed. I've managed to put the type of control into a string:
strCtrlType = sender.ToString()
From here I want to know if and...
I've written this:
rtxtCmdSpy.SelectionStart = rtxtCmdSpy.Find("v")
Dim bfont As New Font(rtxtCmdSpy.Font, FontStyle.Bold)
rtxtCmdSpy.SelectionFont = bfont
rtxtCmdSpy.SelectionColor = Color.Green
rtxtCmdSpy.HideSelection = True
The problem is that the...
I don't understand how this example is out of range:
Dim strText As String = "Gui, Add, Text, vhi ghi, Hello"
Dim intTextLen As Integer = strText.Length
Dim posDlmtr As integer
Dim i As Integer = 1
Dim canLoop As Boolean = True
Do While canLoop =...