Advertisement
Guest User

Form1Designer.vb

a guest
Nov 13th, 2021
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
  2. Partial Class Form1
  3.     Inherits System.Windows.Forms.Form
  4.     Dim MyConsole As New CmdPnl(Me)
  5.     Protected Overrides Sub OnShown(e As EventArgs)
  6.         MyBase.OnShown(e)
  7.         Me.ClientSize = New Size(Me.FontHeight * 40, Me.ClientSize.Height)
  8.         MyConsole.Parent = OutputBox
  9.         MyConsole.Dock = DockStyle.Fill
  10.         MyConsole.WriteLine()
  11.  
  12.     End Sub
  13.  
  14.     'Form overrides dispose to clean up the component list.
  15.    <System.Diagnostics.DebuggerNonUserCode()>
  16.     Protected Overrides Sub Dispose(ByVal disposing As Boolean)
  17.         Try
  18.             If disposing AndAlso components IsNot Nothing Then
  19.                 components.Dispose()
  20.             End If
  21.         Finally
  22.             MyBase.Dispose(disposing)
  23.         End Try
  24.     End Sub
  25.  
  26.     'Required by the Windows Form Designer
  27.    Private components As System.ComponentModel.IContainer
  28.  
  29.     'NOTE: The following procedure is required by the Windows Form Designer
  30.    'It can be modified using the Windows Form Designer.  
  31.    'Do not modify it using the code editor.
  32.    <System.Diagnostics.DebuggerStepThrough()>
  33.     Private Sub InitializeComponent()
  34.         Me.Mine = New System.Windows.Forms.Button()
  35.         Me.Button2 = New System.Windows.Forms.Button()
  36.         Me.SoloRadio = New System.Windows.Forms.RadioButton()
  37.         Me.PoolRadio = New System.Windows.Forms.RadioButton()
  38.         Me.Threads = New System.Windows.Forms.TextBox()
  39.         Me.ThreadLabel = New System.Windows.Forms.Label()
  40.         Me.PrivKeyLabel = New System.Windows.Forms.Label()
  41.         Me.PrivKey = New System.Windows.Forms.TextBox()
  42.         Me.PubKeyLabel = New System.Windows.Forms.Label()
  43.         Me.PubKey = New System.Windows.Forms.TextBox()
  44.         Me.OutputBox = New System.Windows.Forms.RichTextBox()
  45.         Me.WalletLabel = New System.Windows.Forms.Label()
  46.         Me.Wallet = New System.Windows.Forms.TextBox()
  47.         Me.SuspendLayout()
  48.         '
  49.        'Mine
  50.        '
  51.        Me.Mine.DialogResult = System.Windows.Forms.DialogResult.OK
  52.         Me.Mine.Location = New System.Drawing.Point(12, 415)
  53.         Me.Mine.Name = "Mine"
  54.         Me.Mine.Size = New System.Drawing.Size(75, 23)
  55.         Me.Mine.TabIndex = 0
  56.         Me.Mine.Text = "Mine"
  57.         Me.Mine.UseVisualStyleBackColor = True
  58.         '
  59.        'Button2
  60.        '
  61.        Me.Button2.Location = New System.Drawing.Point(537, 415)
  62.         Me.Button2.Name = "Button2"
  63.         Me.Button2.Size = New System.Drawing.Size(75, 23)
  64.         Me.Button2.TabIndex = 0
  65.         Me.Button2.Text = "Exit"
  66.         Me.Button2.UseVisualStyleBackColor = True
  67.         '
  68.        'SoloRadio
  69.        '
  70.        Me.SoloRadio.AutoSize = True
  71.         Me.SoloRadio.Location = New System.Drawing.Point(13, 13)
  72.         Me.SoloRadio.Name = "SoloRadio"
  73.         Me.SoloRadio.Size = New System.Drawing.Size(78, 19)
  74.         Me.SoloRadio.TabIndex = 1
  75.         Me.SoloRadio.TabStop = True
  76.         Me.SoloRadio.Text = "Solo Mine"
  77.         Me.SoloRadio.UseVisualStyleBackColor = True
  78.         '
  79.        'PoolRadio
  80.        '
  81.        Me.PoolRadio.AutoSize = True
  82.         Me.PoolRadio.Location = New System.Drawing.Point(117, 13)
  83.         Me.PoolRadio.Name = "PoolRadio"
  84.         Me.PoolRadio.Size = New System.Drawing.Size(79, 19)
  85.         Me.PoolRadio.TabIndex = 2
  86.         Me.PoolRadio.TabStop = True
  87.         Me.PoolRadio.Text = "Pool Mine"
  88.         Me.PoolRadio.UseVisualStyleBackColor = True
  89.         '
  90.        'Threads
  91.        '
  92.        Me.Threads.Location = New System.Drawing.Point(502, 12)
  93.         Me.Threads.Name = "Threads"
  94.         Me.Threads.Size = New System.Drawing.Size(32, 23)
  95.         Me.Threads.TabIndex = 3
  96.         '
  97.        'ThreadLabel
  98.        '
  99.        Me.ThreadLabel.AutoSize = True
  100.         Me.ThreadLabel.Location = New System.Drawing.Point(317, 15)
  101.         Me.ThreadLabel.Name = "ThreadLabel"
  102.         Me.ThreadLabel.Size = New System.Drawing.Size(179, 15)
  103.         Me.ThreadLabel.TabIndex = 4
  104.         Me.ThreadLabel.Text = "Enter Number of Threads (Max ):"
  105.         '
  106.        'PrivKeyLabel
  107.        '
  108.        Me.PrivKeyLabel.AutoSize = True
  109.         Me.PrivKeyLabel.Location = New System.Drawing.Point(12, 39)
  110.         Me.PrivKeyLabel.Name = "PrivKeyLabel"
  111.         Me.PrivKeyLabel.Size = New System.Drawing.Size(98, 15)
  112.         Me.PrivKeyLabel.TabIndex = 5
  113.         Me.PrivKeyLabel.Text = "Enter Private Key:"
  114.         '
  115.        'PrivKey
  116.        '
  117.        Me.PrivKey.Location = New System.Drawing.Point(116, 36)
  118.         Me.PrivKey.Name = "PrivKey"
  119.         Me.PrivKey.Size = New System.Drawing.Size(100, 23)
  120.         Me.PrivKey.TabIndex = 6
  121.         '
  122.        'PubKeyLabel
  123.        '
  124.        Me.PubKeyLabel.AutoSize = True
  125.         Me.PubKeyLabel.Location = New System.Drawing.Point(249, 39)
  126.         Me.PubKeyLabel.Name = "PubKeyLabel"
  127.         Me.PubKeyLabel.Size = New System.Drawing.Size(95, 15)
  128.         Me.PubKeyLabel.TabIndex = 7
  129.         Me.PubKeyLabel.Text = "Enter Public Key:"
  130.         '
  131.        'PubKey
  132.        '
  133.        Me.PubKey.Location = New System.Drawing.Point(350, 36)
  134.         Me.PubKey.Name = "PubKey"
  135.         Me.PubKey.Size = New System.Drawing.Size(100, 23)
  136.         Me.PubKey.TabIndex = 8
  137.         '
  138.        'OutputBox
  139.        '
  140.        Me.OutputBox.BackColor = System.Drawing.Color.HotPink
  141.         Me.OutputBox.Location = New System.Drawing.Point(13, 65)
  142.         Me.OutputBox.Name = "OutputBox"
  143.         Me.OutputBox.Size = New System.Drawing.Size(599, 344)
  144.         Me.OutputBox.TabIndex = 9
  145.         Me.OutputBox.Text = ""
  146.         '
  147.        'WalletLabel
  148.        '
  149.        Me.WalletLabel.AutoSize = True
  150.         Me.WalletLabel.Location = New System.Drawing.Point(12, 39)
  151.         Me.WalletLabel.Name = "WalletLabel"
  152.         Me.WalletLabel.Size = New System.Drawing.Size(118, 15)
  153.         Me.WalletLabel.TabIndex = 10
  154.         Me.WalletLabel.Text = "Enter Wallet Address:"
  155.         '
  156.        'Wallet
  157.        '
  158.        Me.Wallet.Location = New System.Drawing.Point(136, 36)
  159.         Me.Wallet.Name = "Wallet"
  160.         Me.Wallet.Size = New System.Drawing.Size(100, 23)
  161.         Me.Wallet.TabIndex = 11
  162.         '
  163.        'Form1
  164.        '
  165.        Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
  166.         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
  167.         Me.CancelButton = Me.Button2
  168.         Me.ClientSize = New System.Drawing.Size(640, 446)
  169.         Me.Controls.Add(Me.Wallet)
  170.         Me.Controls.Add(Me.WalletLabel)
  171.         Me.Controls.Add(Me.OutputBox)
  172.         Me.Controls.Add(Me.PubKey)
  173.         Me.Controls.Add(Me.PubKeyLabel)
  174.         Me.Controls.Add(Me.PrivKey)
  175.         Me.Controls.Add(Me.PrivKeyLabel)
  176.         Me.Controls.Add(Me.ThreadLabel)
  177.         Me.Controls.Add(Me.Threads)
  178.         Me.Controls.Add(Me.PoolRadio)
  179.         Me.Controls.Add(Me.SoloRadio)
  180.         Me.Controls.Add(Me.Button2)
  181.         Me.Controls.Add(Me.Mine)
  182.         Me.Name = "Form1"
  183.         Me.Text = "Form1"
  184.         Me.ResumeLayout(False)
  185.         Me.PerformLayout()
  186.  
  187.     End Sub
  188.  
  189.     Friend WithEvents Mine As Button
  190.     Friend WithEvents Button2 As Button
  191.     Friend WithEvents SoloRadio As RadioButton
  192.     Friend WithEvents PoolRadio As RadioButton
  193.     Friend WithEvents Threads As TextBox
  194.     Friend WithEvents ThreadLabel As Label
  195.     Friend WithEvents PrivKeyLabel As Label
  196.     Friend WithEvents PrivKey As TextBox
  197.     Friend WithEvents PubKeyLabel As Label
  198.     Friend WithEvents PubKey As TextBox
  199.     Friend WithEvents OutputBox As RichTextBox
  200.     Friend WithEvents WalletLabel As Label
  201.     Friend WithEvents Wallet As TextBox
  202.  
  203.  
  204. End Class
  205. Public Class CmdPnl
  206.     Inherits Panel
  207.     Dim P As New Process
  208.     Friend TB As New TextBox
  209.     Friend RTB As New RichTextBox
  210.  
  211.     Delegate Sub UpdateRTB(SelectionColor As Color, Text As String)
  212.     Dim UpdateRTBDelegate As UpdateRTB = AddressOf UpdateRTBMethod
  213.     Public Sub New(Parent As Form)
  214.         TB.Parent = Me
  215.         TB.Location = New Point(0, 0)
  216.         TB.Dock = DockStyle.Top
  217.         AddHandler TB.KeyPress, AddressOf TB_KeyPress
  218.         RTB.ContextMenuStrip = New ContextMenuStrip
  219.         RTB.ContextMenuStrip.ShowImageMargin = False
  220.         Dim MenuItems() As String = {"Cut", "Copy", "Paste"}
  221.         For I As Integer = 0 To MenuItems.Length - 1
  222.             RTB.ContextMenuStrip.Items.Add(MenuItems(I))
  223.             AddHandler RTB.ContextMenuStrip.Items(I).Click, AddressOf MI_Click
  224.         Next
  225.         RTB.Location = New System.Drawing.Point(13, 65)
  226.         RTB.Size = New System.Drawing.Size(775, 344)
  227.         RTB.Parent = Me
  228.         RTB.BringToFront()
  229.         RTB.Dock = DockStyle.Fill
  230.         Me.Parent = Parent
  231.         SetProcess()
  232.     End Sub
  233.     Sub MI_Click(sender As Object, e As EventArgs)
  234.         Select Case DirectCast(sender, ToolStripMenuItem).Text
  235.             Case "Cut"
  236.                 RTB.Cut()
  237.             Case "Copy"
  238.                 RTB.Copy()
  239.             Case "Paste"
  240.                 RTB.Paste()
  241.         End Select
  242.     End Sub
  243.     Private Sub SetProcess()
  244.         P.StartInfo.FileName = "pwsh.exe"
  245.  
  246.         P.StartInfo.RedirectStandardError = True
  247.         P.StartInfo.RedirectStandardInput = True
  248.         P.StartInfo.RedirectStandardOutput = True
  249.         P.StartInfo.CreateNoWindow = True
  250.         P.StartInfo.UseShellExecute = False
  251.         AddHandler P.ErrorDataReceived, AddressOf P_ErrorDataReceived
  252.         AddHandler P.OutputDataReceived, AddressOf P_OutputDataReceived
  253.         P.Start()
  254.         P.BeginErrorReadLine()
  255.         P.BeginOutputReadLine()
  256.     End Sub
  257.     Private Sub TB_KeyPress(sender As Object, e As KeyPressEventArgs)
  258.         If e.KeyChar = Chr(13) Then
  259.  
  260.             Me.WriteLine()
  261.             e.Handled = True
  262.         End If
  263.     End Sub
  264.     Sub WriteLine()
  265.         P.StandardInput.WriteLine(TB.Text)
  266.     End Sub
  267.     Private Sub P_ErrorDataReceived(sender As Object, e As DataReceivedEventArgs)
  268.         Me.Invoke(UpdateRTBDelegate, New Object() {Color.Red, e.Data})
  269.  
  270.     End Sub
  271.     Private Sub P_OutputDataReceived(sender As Object, e As DataReceivedEventArgs)
  272.         Me.Invoke(UpdateRTBDelegate, New Object() {Color.Green, e.Data})
  273.     End Sub
  274.     Sub UpdateRTBMethod(SelectionColor As Color, Text As String)
  275.         RTB.SelectionColor = SelectionColor
  276.         RTB.SelectedText = Text + Environment.NewLine
  277.         RTB.ScrollToCaret()
  278.     End Sub
  279. End Class
  280.  
  281.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement