' ConsultantBSGenerator example ' Choose random verb, adjective, and noun. Combine to make a ' "consultantese" sentence. Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents txtOutput As System.Windows.Forms.TextBox Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu Friend WithEvents mnuGenerate As System.Windows.Forms.MenuItem Private Sub InitializeComponent() Me.txtOutput = New System.Windows.Forms.TextBox Me.MainMenu1 = New System.Windows.Forms.MainMenu Me.mnuGenerate = New System.Windows.Forms.MenuItem Me.SuspendLayout() ' 'txtOutput ' Me.txtOutput.BackColor = System.Drawing.Color.White Me.txtOutput.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtOutput.Location = New System.Drawing.Point(24, 16) Me.txtOutput.Name = "txtOutput" Me.txtOutput.ReadOnly = True Me.txtOutput.Size = New System.Drawing.Size(496, 22) Me.txtOutput.TabIndex = 0 Me.txtOutput.Text = "" ' 'MainMenu1 ' Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuGenerate}) ' 'mnuGenerate ' Me.mnuGenerate.Index = 0 Me.mnuGenerate.Text = "Generate Random Sentence" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(544, 62) Me.Controls.Add(Me.txtOutput) Me.Menu = Me.MainMenu1 Me.Name = "Form1" Me.Text = "Consultant BS Generator" Me.ResumeLayout(False) End Sub #End Region ' Create Random object for generating random numbers. Private randomNumberGenerator As New Random ' Arrays of words to choose randomly. Private verb() As String = {"architect", "e-enable", "facilitate", "harness", _ "incentivize", "leverage", "optimize", "synergize", "unleach", "whiteboard"} Private adjective() As String = {"24/7", "collaborative", "cutting-edge", _ "collaborative", "dynamic", "end-to-end", "granular", "intuitive", _ "mission-critical", "plug-and-play", "seamless"} Private noun() As String = {"action-items", "applications", "bandwidth", _ "deliverables", "infrastructures", "markets", "interfaces", _ "technologies", "schemas", "synergies"} ' When menu item is clicked, generate random sentence. Private Sub mnuGenerate_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles mnuGenerate.Click Dim i, j, k As Integer i = randomNumberGenerator.Next(0, 10) j = randomNumberGenerator.Next(0, 10) k = randomNumberGenerator.Next(0, 10) txtOutput.Text = "Our consultants will help you " & _ verb(i) & " " & adjective(j) & " " & noun(k) & "." End Sub ' If user tries to resize, set size to original values. Private Sub Form1_Resize(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles MyBase.Resize Me.Size = New Size(544, 112) End Sub End Class