|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
ScreenshotsNormal single-line InputBoxMulti-line InputBox
Demo appUsing the classJust add a reference to InputBox.dll in your project. The class is
part of the namespace InputBox Constructor
Example:- InputBox m_ib = new InputBox(); InputBox m_multi_ib = new InputBox(true); Show() - The key functionThis has two overloads.
Return Value The String that was entered is returned, if the OK button was clicked. If the Cancel button was clicked an empty string is returned. Sample CodeInputBox m_ib = new InputBox(true); this.textBox2.Text = m_ib.Show("Enter your address please.", "Your address"); The class structure// InputBox.h
#pragma once
using namespace System;
using namespace System::ComponentModel;
using namespace System::Drawing;
using namespace System::Windows::Forms;
namespace CodeProject
{
namespace WinForms
{
public __gc class InputBox
{
private:
Form* InputForm;
TextBox* InputText;
Label* PromptText;
Button* BtnOk;
Button* BtnCancel;
bool m_multiline;
void InitializeComponent();
String* Show();
void BtnOk_Click(Object* sender,
EventArgs* e);
void BtnCancel_Click(Object* sender,
EventArgs* e);
public:
InputBox();
InputBox(bool);
String* Show(String* prompt);
String* Show(String* prompt, String* title);
};
}
}
|
||||||||||||||||||||||