Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6108441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:17:48+00:00 2026-05-23T14:17:48+00:00

Yes, this is a really bad question, probably one that any half decent VB.NET

  • 0

Yes, this is a really bad question, probably one that any half decent VB.NET programmer should know. Well, I am new to VB.NET, so I need a little help.

I have created a windows forms class along side another one, and its code is this:

Imports System.Windows.Forms

Public Class Form2

    Protected m_BlankValid As Boolean = True
    Protected m_ReturnText As String = ""

    Public Overloads Function ShowDialog( _
      ByVal TitleText As String, _
      ByVal PromptText As String, _
      ByVal DefaultText As String, _
      ByRef EnteredText As String, _
      ByVal BlankValid As Boolean) As System.Windows.Forms.DialogResult
        m_BlankValid = BlankValid
        Me.PromptLabel.Text = PromptText
        Me.Text = TitleText
        Me.Txt_TextEntry.Text = DefaultText
        Me.ShowDialog()
        EnteredText = m_ReturnText
        Return Me.DialogResult
    End Function

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        If Me.Txt_TextEntry.Text = "" Then
            Me.OK_Btn.Enabled = m_BlankValid
        Else
            Me.OK_Btn.Enabled = True
        End If
    End Sub

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        m_ReturnText = Me.Txt_TextEntry.Text
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        m_ReturnText = ""
        Me.Close()
    End Sub
End Class

Obviously, I have some graphics on my Design.

To call my class, I would like to use the following code:

Dim TextReturned As String = ""
Dim a As New InputBox
If a.ShowDialog("The Title", "The Prompt", "Default", TextReturned, False) = Windows.Forms.DialogResult.Cancel Then
    ' Cancel Pressed
    Beep()
Else
    '
End If

My error is that Type ‘InputBox’ is not defined. How can I make it such that it is defined?

Thanks,

Odinulf

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:17:48+00:00Added an answer on May 23, 2026 at 2:17 pm

    Assuming your code above is copy/pasted from your actual code, your class is named Form2 not InputBox. Change the class declaration on your custom form to Public Class InputBox

    If your the snippets above just have a typo, that may change things, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Yes, I know that UndecidableInstances can be bad. I really tried hard to design
I know the Sales pitch answer is yes to this question, but is it
When I asked this question I got almost always a definite yes you should
Yes this question as already been asked here at SO. The problem is that
This question falls into the yes - this works, yes - this is ugly,
Yes, this is a programming-related question, if a little indirectly. For better or worse,
If yes then presentational elements would be helpful in this condition so should we
So I realize this question sounds stupid (and yes I am using a dual
Yes, I know, I know, parsing HTML with regular expressions is very bad. But
This is a memory allocation issue that I've never really understood. void unleashMonkeyFish() {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.