Search results

  1. mevets

    DirectCast name of control

    thanks, worked great.
  2. mevets

    DirectCast name of control

    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? Unsuccessful with: Dim nameofctrl As Object = Textbox1.text DirectCast(nameofctrl, Control).BackColor = Color.Green
  3. mevets

    Ctype function

    yeah, it is
  4. mevets

    Ctype function

    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!
  5. mevets

    Ctype function

    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 Case "Text" If btnCTRLSText.CheckState = CheckState.Checked Then newCtrl.Name =...
  6. mevets

    Var on diff Form

    Form1.vb Customize.vb 'clrHi = Color.Tan' from Form1 is green underlined, this fine?
  7. mevets

    Var on diff Form

    How do I write to a var on Form1 from Form2?
  8. mevets

    Wrong color

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Button1.BackColor = Button1.BackColor End Sub ----------- There was no point to the .red, it was simply there to show the color had to change for another reason which isn't...
  9. mevets

    Wrong color

    Are you using XP theme?
  10. mevets

    Wrong color

    Oddly, that answers different question of mine. My problem is that the color is not the gradient-color that all buttons have by default.
  11. mevets

    Wrong color

    When I Dim c as Color = btn.color btn.color = color.red btn.color = c The color seems to be wrong. Is there a solution?
  12. mevets

    sender.???

    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 Ctype(sender.name, string) That ofcourse does not work, but an example I had and lost I think described the solution that way. Any suggestions?
  13. mevets

    Dim statement question

    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...
  14. mevets

    Dim statement question

    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...
  15. mevets

    RichTextbox colors w/o using a Selection

    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...
  16. mevets

    .Substring out of range

    thanks works perfectly!
  17. mevets

    .Substring out of range

    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 =...
Top Bottom