VB.net के InputDialog का C # संस्करण क्या है?


150

VB.net के InputBox का C # संस्करण क्या है?

जवाबों:


233

के लिए एक संदर्भ जोड़ें Microsoft.VisualBasic, InputBoxमें है Microsoft.VisualBasic.Interactionनाम स्थान:

using Microsoft.VisualBasic;
string input = Interaction.InputBox("Prompt", "Title", "Default", x_coordinate, y_coordinate);

केवल पहला तर्क promptअनिवार्य है


अगर मुझे उपयोगकर्ता से पासवर्ड प्राप्त करना है तो क्या होगा?
hims056

3
@ hims056 InputBoxमूल रूप से नकाबपोश इनपुट का समर्थन नहीं करता है। आपको अपने स्वयं के इनपुट फ़ॉर्म को रोल करना होगा।
ओजगुर Ozcitak

4
बस आयात करें using Microsoft.VisualBasicताकि आप सिर्फ लिखेंInteraction.InputBox()
एडवर्ड करक

क्या वीबी इनपुट बॉक्स को शुरू से ही वहां भरे जाने के लिए एक मूल्य दिया जा सकता है? (संपादित करें) कोई बात नहीं, यह "डिफ़ॉल्ट" है, मैं देख रहा हूं।
Nyerguds

3
मैंने कम से कम 10 बार इसके लिए खोज की है। हमेशा इस जवाब पर परिणाम। अगर मैं कर सकता तो फिर से उत्थान करूंगा। धन्यवाद!
C4d

108

इसका सारांश प्रस्तुत करना:

  • नहीं है सी # में से कोई भी
  • आप Microsoft से संदर्भ जोड़कर Visual Basic से संवाद का उपयोग कर सकते हैं।

    1. में समाधान एक्सप्लोरर राइट क्लिक पर संदर्भ फ़ोल्डर।
    2. संदर्भ जोड़ें का चयन करें ...
    3. में नेट टैब (- नए दृश्य स्टूडियो verions में विधानसभा टैब) - चयन Microsoft.VisualBasic
    4. ओके पर क्लिक करें

फिर आप पहले बताए गए कोड का उपयोग कर सकते हैं:

string input = Microsoft.VisualBasic.Interaction.InputBox("Prompt", "Title", "Default", 0, 0);

उस ने कहा, मेरा सुझाव है कि आप पहली बार में एक इनपुट बॉक्स की आवश्यकता पर विचार करें। संवाद हमेशा चीजों को करने का सबसे अच्छा तरीका नहीं है और कभी-कभी वे अच्छे से अधिक नुकसान करते हैं - लेकिन यह विशेष स्थिति पर निर्भर करता है।


आप उस संदर्भ को भी जोड़कर C # से संवाद का उपयोग कर सकते हैं।
जोएल कोएहॉर्न

3
हाँ, वे हैं। लेकिन यह मुझे लगता है कि ज्यादातर मामलों में वे शिपिंग कोड में खराब हैं।
टॉमस सेडोविक

लिंक टॉमस के लिए +1 पोस्ट किया गया। यह वर्चुअल बेसिक इनपुटबॉक्स से बेहतर है।
जो.वांग

अभी भी / सबसिस्टम का उपयोग करने से बेहतर है: कंसोल ... कभी-कभी आपको केवल उपयोगकर्ता के साथ बहुत कम सहभागिता की आवश्यकता होती है, और फिर आप उनका उपयोग कर सकते हैं, बजाय इसके कि आपका 90% कोड UI के लिए हो।
नूलानो

मैंने "किसी और के विकल्प का उपयोग करें" विकल्प को चुना है और इस परिणाम से खुश हूं: इस एक से: प्रतिबिंबnl / blog / 2003 / c-inputbox । कारण मैंने चुना कि एक हार्डकोडेड आकार / स्थान मानों की अनुपस्थिति थी। होनहार, csharp-examples.net/inputbox-class भी है । इन दोनों पहले दो में दर्ज पाठ की मान्यता है। के लिए स्वीकार किए जाते हैं जवाब stackoverflow.com/questions/5427020/... भी अच्छा लग रहा है, लेकिन इनपुट सत्यापन सुविधा शामिल नहीं है।
डेवलपर

106

एक संवाद बॉक्स का गतिशील निर्माण। आप अपने स्वाद के लिए अनुकूलित कर सकते हैं।

ध्यान दें कि विनफॉर्म को छोड़कर यहां कोई बाहरी निर्भरता नहीं है

private static DialogResult ShowInputDialog(ref string input)
    {
        System.Drawing.Size size = new System.Drawing.Size(200, 70);
        Form inputBox = new Form();

        inputBox.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
        inputBox.ClientSize = size;
        inputBox.Text = "Name";

        System.Windows.Forms.TextBox textBox = new TextBox();
        textBox.Size = new System.Drawing.Size(size.Width - 10, 23);
        textBox.Location = new System.Drawing.Point(5, 5);
        textBox.Text = input;
        inputBox.Controls.Add(textBox);

        Button okButton = new Button();
        okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
        okButton.Name = "okButton";
        okButton.Size = new System.Drawing.Size(75, 23);
        okButton.Text = "&OK";
        okButton.Location = new System.Drawing.Point(size.Width - 80 - 80, 39);
        inputBox.Controls.Add(okButton);

        Button cancelButton = new Button();
        cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        cancelButton.Name = "cancelButton";
        cancelButton.Size = new System.Drawing.Size(75, 23);
        cancelButton.Text = "&Cancel";
        cancelButton.Location = new System.Drawing.Point(size.Width - 80, 39);
        inputBox.Controls.Add(cancelButton);

        inputBox.AcceptButton = okButton;
        inputBox.CancelButton = cancelButton; 

        DialogResult result = inputBox.ShowDialog();
        input = textBox.Text;
        return result;
    }

प्रयोग

string input="hede";
ShowInputDialog(ref input);

3
ठीक है, बहुत आसान है, मैंने इसे पाया: inputBox.AcceptButton = okButton; inputBox.CancelButton = CancelButton;
FIV

1
काम कर रहे! VB समाधान से बेहतर है। धन्यवाद behhorf!
फ़िलिप याबा पोलीडो

8
inputBox.StartPosition = FormStartPosition.CenterParent; मूल विंडो पर संवाद केंद्रित करेगा।
एंड्रयू कैश

2
अपना कोड लिखने और इसे यहाँ साझा करने के लिए +1! अन्य ऐसा करने के लिए बहुत आलसी हैं और बस आसान मुक्त अंक चाहते हैं।
कैरन

1
इकाई परीक्षण में उपयोग किए जाने पर प्रपत्र दिखाई नहीं देता है, यह पोस्ट सहायक होगी। stackoverflow.com/questions/1218517/…
रे चेंग

9

एक नहीं है। यदि आप वास्तव में C # में VB InputBox का उपयोग करना चाहते हैं तो आप कर सकते हैं। बस Microsoft.VisualBasic.dll का संदर्भ जोड़ें और आप इसे वहां पाएंगे।

लेकिन मैं इसका उपयोग नहीं करने का सुझाव दूंगा । यह बदसूरत और पुराना IMO है।


18
मुझे लगता है कि आप बहुत दयालु हैं। यह उससे कहीं अधिक बदसूरत और पुराना है!
ब्लैकवैप

3
पहचान नहीं हो पा cancelसे empty input stringवास्तव में एक बग IMO है।
जो.वांग

6

न केवल आपको प्रोजेक्ट के लिए अपनी संदर्भ सूची में Microsoft.VisualBasic जोड़ना चाहिए, बल्कि आपको 'Microsoft.VisualBasic का उपयोग करके' भी घोषित करना चाहिए; इसलिए आपको बस Microsoft के बजाय 'इंटरैक्शन.इन्पुटबॉक्स ("...") का उपयोग करना होगा। विवादास्पद।


3
यदि आप इसे केवल एक बार उपयोग कर रहे हैं, तो यह अव्यवस्था जोड़ता है यदि ओपी फैसला करता है कि वे इनपुटबॉक्स को अब और नहीं चाहते हैं। साथ ही, यह एक टिप्पणी होनी चाहिए।
BalinKingOfMoria CMs

5

उपयोगकर्ता द्वारा दर्ज की गई स्ट्रिंग लौटाता है; खाली स्ट्रिंग यदि वे हिट करते हैं Cancel:

    public static String InputBox(String caption, String prompt, String defaultText)
    {
        String localInputText = defaultText;
        if (InputQuery(caption, prompt, ref localInputText))
        {
            return localInputText;
        }
        else
        {
            return "";
        }
    }

Stringएक रेफरी पैरामीटर के रूप में लौटाता है , trueअगर वे हिट करते हैं OK, या falseयदि वे हिट करते हैं Cancel:

    public static Boolean InputQuery(String caption, String prompt, ref String value)
    {
        Form form;
        form = new Form();
        form.AutoScaleMode = AutoScaleMode.Font;
        form.Font = SystemFonts.IconTitleFont;

        SizeF dialogUnits;
        dialogUnits = form.AutoScaleDimensions;

        form.FormBorderStyle = FormBorderStyle.FixedDialog;
        form.MinimizeBox = false;
        form.MaximizeBox = false;
        form.Text = caption;

        form.ClientSize = new Size(
                    Toolkit.MulDiv(180, dialogUnits.Width, 4),
                    Toolkit.MulDiv(63, dialogUnits.Height, 8));

        form.StartPosition = FormStartPosition.CenterScreen;

        System.Windows.Forms.Label lblPrompt;
        lblPrompt = new System.Windows.Forms.Label();
        lblPrompt.Parent = form;
        lblPrompt.AutoSize = true;
        lblPrompt.Left = Toolkit.MulDiv(8, dialogUnits.Width, 4);
        lblPrompt.Top = Toolkit.MulDiv(8, dialogUnits.Height, 8);
        lblPrompt.Text = prompt;

        System.Windows.Forms.TextBox edInput;
        edInput = new System.Windows.Forms.TextBox();
        edInput.Parent = form;
        edInput.Left = lblPrompt.Left;
        edInput.Top = Toolkit.MulDiv(19, dialogUnits.Height, 8);
        edInput.Width = Toolkit.MulDiv(164, dialogUnits.Width, 4);
        edInput.Text = value;
        edInput.SelectAll();


        int buttonTop = Toolkit.MulDiv(41, dialogUnits.Height, 8);
        //Command buttons should be 50x14 dlus
        Size buttonSize = Toolkit.ScaleSize(new Size(50, 14), dialogUnits.Width / 4, dialogUnits.Height / 8);

        System.Windows.Forms.Button bbOk = new System.Windows.Forms.Button();
        bbOk.Parent = form;
        bbOk.Text = "OK";
        bbOk.DialogResult = DialogResult.OK;
        form.AcceptButton = bbOk;
        bbOk.Location = new Point(Toolkit.MulDiv(38, dialogUnits.Width, 4), buttonTop);
        bbOk.Size = buttonSize;

        System.Windows.Forms.Button bbCancel = new System.Windows.Forms.Button();
        bbCancel.Parent = form;
        bbCancel.Text = "Cancel";
        bbCancel.DialogResult = DialogResult.Cancel;
        form.CancelButton = bbCancel;
        bbCancel.Location = new Point(Toolkit.MulDiv(92, dialogUnits.Width, 4), buttonTop);
        bbCancel.Size = buttonSize;

        if (form.ShowDialog() == DialogResult.OK)
        {
            value = edInput.Text;
            return true;
        }
        else
        {
            return false;
        }
    }

    /// <summary>
    /// Multiplies two 32-bit values and then divides the 64-bit result by a 
    /// third 32-bit value. The final result is rounded to the nearest integer.
    /// </summary>
    public static int MulDiv(int nNumber, int nNumerator, int nDenominator)
    {
        return (int)Math.Round((float)nNumber * nNumerator / nDenominator);
    }

नोट : कोई भी कोड सार्वजनिक डोमेन में जारी किया जाता है। कोई एट्रिब्यूशन की आवश्यकता नहीं है।


public static int MulDiv (int number, int numerator, int denominator) {वापसी (int) (((लंबी) संख्या * अंश + (भाजक >> 1)) / भाजक); }
पीटर कलीफ 'दीदीसॉफ्ट

क्या है Toolkit?
मार्कस एल

1
@markusL टूलकिट मेरी कक्षा थी, जिसके कार्यान्वयन को रखती है MulDiv। उदाहरण के कार्यान्वयन के लिए आप पीटर की टिप्पणी देख सकते हैं MulDiv
इयान बॉयड

4

Microsoft.VisualBasicइस फ़ंक्शन का संदर्भ जोड़ें और उसका उपयोग करें:

string response =  Microsoft.VisualBasic.Interaction.InputBox("What's 1+1?", "Title", "2", 0, 0);

अंतिम 2 नंबर इनपुट संवाद प्रदर्शित करने के लिए एक एक्स / वाई स्थिति है।


3

आपका मतलब इनपुटबॉक्स है? बस Microsoft में देखें ।VisualBasic नाम स्थान।

C # और VB.Net एक साझा पुस्तकालय साझा करते हैं। यदि एक भाषा इसका उपयोग कर सकती है, तो दूसरी भी।


2

Microsoft.VisualBasic का संदर्भ जोड़े बिना:

// "dynamic" requires reference to Microsoft.CSharp
Type tScriptControl = Type.GetTypeFromProgID("ScriptControl");
dynamic oSC = Activator.CreateInstance(tScriptControl);

oSC.Language = "VBScript";
string sFunc = @"Function InBox(prompt, title, default) 
InBox = InputBox(prompt, title, default)    
End Function
";
oSC.AddCode(sFunc);
dynamic Ret = oSC.Run("InBox", "メッセージ", "タイトル", "初期値");

अधिक जानकारी के लिए इन्हें देखें: JScript Input में
ScriptControl
MsgBox और JScript
में MsgBox

.NET 2.0:

string sFunc = @"Function InBox(prompt, title, default) 
InBox = InputBox(prompt, title, default)    
End Function
";

Type tScriptControl = Type.GetTypeFromProgID("ScriptControl");
object oSC = Activator.CreateInstance(tScriptControl);

// https://github.com/mono/mono/blob/master/mcs/class/corlib/System/MonoType.cs
// System.Reflection.PropertyInfo pi = tScriptControl.GetProperty("Language", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.CreateInstance| System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.SetProperty | System.Reflection.BindingFlags.IgnoreCase);
// pi.SetValue(oSC, "VBScript", null);

tScriptControl.InvokeMember("Language", System.Reflection.BindingFlags.SetProperty, null, oSC, new object[] { "VBScript" });
tScriptControl.InvokeMember("AddCode", System.Reflection.BindingFlags.InvokeMethod, null, oSC, new object[] { sFunc });
object ret = tScriptControl.InvokeMember("Run", System.Reflection.BindingFlags.InvokeMethod, null, oSC, new object[] { "InBox", "メッセージ", "タイトル", "初期値" });
Console.WriteLine(ret);

2

मैं अपने स्वयं के कोडन द्वारा इसे प्राप्त करने में सक्षम था। मुझे बड़े पुस्तकालय के लिए और किसी चीज़ के लिए कुछ हद तक भरोसा करना पसंद नहीं है।

फार्म और डिजाइनर:

public partial class InputBox 
    : Form
{

    public String Input
    {
        get { return textInput.Text; }
    }

    public InputBox()
    {
        InitializeComponent();
    }

    private void button2_Click(object sender, EventArgs e)
    {
        DialogResult = System.Windows.Forms.DialogResult.OK;
    }

    private void button1_Click(object sender, EventArgs e)
    {
        DialogResult = System.Windows.Forms.DialogResult.Cancel;
    }

    private void InputBox_Load(object sender, EventArgs e)
    {
        this.ActiveControl = textInput;
    }

    public static DialogResult Show(String title, String message, String inputTitle, out String inputValue)
    {
        InputBox inputBox = null;
        DialogResult results = DialogResult.None;

        using (inputBox = new InputBox() { Text = title })
        {
            inputBox.labelMessage.Text = message;
            inputBox.splitContainer2.SplitterDistance = inputBox.labelMessage.Width;
            inputBox.labelInput.Text = inputTitle;
            inputBox.splitContainer1.SplitterDistance = inputBox.labelInput.Width;
            inputBox.Size = new Size(
                inputBox.Width,
                8 + inputBox.labelMessage.Height + inputBox.splitContainer2.SplitterWidth + inputBox.splitContainer1.Height + 8 + inputBox.button2.Height + 12 + (50));
            results = inputBox.ShowDialog();
            inputValue = inputBox.Input;
        }

        return results;
    }

    void labelInput_TextChanged(object sender, System.EventArgs e)
    {
    }

}

partial class InputBox
{
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;

    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    {
        if (disposing && (components != null))
        {
            components.Dispose();
        }
        base.Dispose(disposing);
    }

    #region Windows Form Designer generated code

    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
        this.labelMessage = new System.Windows.Forms.Label();
        this.button1 = new System.Windows.Forms.Button();
        this.button2 = new System.Windows.Forms.Button();
        this.labelInput = new System.Windows.Forms.Label();
        this.textInput = new System.Windows.Forms.TextBox();
        this.splitContainer1 = new System.Windows.Forms.SplitContainer();
        this.splitContainer2 = new System.Windows.Forms.SplitContainer();
        ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
        this.splitContainer1.Panel1.SuspendLayout();
        this.splitContainer1.Panel2.SuspendLayout();
        this.splitContainer1.SuspendLayout();
        ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
        this.splitContainer2.Panel1.SuspendLayout();
        this.splitContainer2.Panel2.SuspendLayout();
        this.splitContainer2.SuspendLayout();
        this.SuspendLayout();
        // 
        // labelMessage
        // 
        this.labelMessage.AutoSize = true;
        this.labelMessage.Location = new System.Drawing.Point(3, 0);
        this.labelMessage.MaximumSize = new System.Drawing.Size(379, 0);
        this.labelMessage.Name = "labelMessage";
        this.labelMessage.Size = new System.Drawing.Size(50, 13);
        this.labelMessage.TabIndex = 99;
        this.labelMessage.Text = "Message";
        // 
        // button1
        // 
        this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
        this.button1.Location = new System.Drawing.Point(316, 126);
        this.button1.Name = "button1";
        this.button1.Size = new System.Drawing.Size(75, 23);
        this.button1.TabIndex = 3;
        this.button1.Text = "Cancel";
        this.button1.UseVisualStyleBackColor = true;
        this.button1.Click += new System.EventHandler(this.button1_Click);
        // 
        // button2
        // 
        this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
        this.button2.Location = new System.Drawing.Point(235, 126);
        this.button2.Name = "button2";
        this.button2.Size = new System.Drawing.Size(75, 23);
        this.button2.TabIndex = 2;
        this.button2.Text = "OK";
        this.button2.UseVisualStyleBackColor = true;
        this.button2.Click += new System.EventHandler(this.button2_Click);
        // 
        // labelInput
        // 
        this.labelInput.AutoSize = true;
        this.labelInput.Location = new System.Drawing.Point(3, 6);
        this.labelInput.Name = "labelInput";
        this.labelInput.Size = new System.Drawing.Size(31, 13);
        this.labelInput.TabIndex = 99;
        this.labelInput.Text = "Input";
        this.labelInput.TextChanged += new System.EventHandler(this.labelInput_TextChanged);
        // 
        // textInput
        // 
        this.textInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
        | System.Windows.Forms.AnchorStyles.Right)));
        this.textInput.Location = new System.Drawing.Point(3, 3);
        this.textInput.Name = "textInput";
        this.textInput.Size = new System.Drawing.Size(243, 20);
        this.textInput.TabIndex = 1;
        // 
        // splitContainer1
        // 
        this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
        this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
        this.splitContainer1.IsSplitterFixed = true;
        this.splitContainer1.Location = new System.Drawing.Point(0, 0);
        this.splitContainer1.Name = "splitContainer1";
        // 
        // splitContainer1.Panel1
        // 
        this.splitContainer1.Panel1.Controls.Add(this.labelInput);
        // 
        // splitContainer1.Panel2
        // 
        this.splitContainer1.Panel2.Controls.Add(this.textInput);
        this.splitContainer1.Size = new System.Drawing.Size(379, 50);
        this.splitContainer1.SplitterDistance = 126;
        this.splitContainer1.TabIndex = 99;
        // 
        // splitContainer2
        // 
        this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
        | System.Windows.Forms.AnchorStyles.Left) 
        | System.Windows.Forms.AnchorStyles.Right)));
        this.splitContainer2.IsSplitterFixed = true;
        this.splitContainer2.Location = new System.Drawing.Point(12, 12);
        this.splitContainer2.Name = "splitContainer2";
        this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
        // 
        // splitContainer2.Panel1
        // 
        this.splitContainer2.Panel1.Controls.Add(this.labelMessage);
        // 
        // splitContainer2.Panel2
        // 
        this.splitContainer2.Panel2.Controls.Add(this.splitContainer1);
        this.splitContainer2.Size = new System.Drawing.Size(379, 108);
        this.splitContainer2.SplitterDistance = 54;
        this.splitContainer2.TabIndex = 99;
        // 
        // InputBox
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(403, 161);
        this.Controls.Add(this.splitContainer2);
        this.Controls.Add(this.button2);
        this.Controls.Add(this.button1);
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
        this.MaximizeBox = false;
        this.MinimizeBox = false;
        this.Name = "InputBox";
        this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
        this.Text = "Title";
        this.TopMost = true;
        this.Load += new System.EventHandler(this.InputBox_Load);
        this.splitContainer1.Panel1.ResumeLayout(false);
        this.splitContainer1.Panel1.PerformLayout();
        this.splitContainer1.Panel2.ResumeLayout(false);
        this.splitContainer1.Panel2.PerformLayout();
        ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
        this.splitContainer1.ResumeLayout(false);
        this.splitContainer2.Panel1.ResumeLayout(false);
        this.splitContainer2.Panel1.PerformLayout();
        this.splitContainer2.Panel2.ResumeLayout(false);
        ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
        this.splitContainer2.ResumeLayout(false);
        this.ResumeLayout(false);

    }

    #endregion

    private System.Windows.Forms.Label labelMessage;
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.Button button2;
    private System.Windows.Forms.Label labelInput;
    private System.Windows.Forms.TextBox textInput;
    private System.Windows.Forms.SplitContainer splitContainer1;
    private System.Windows.Forms.SplitContainer splitContainer2;
}

उपयोग:

String output = "";

result = System.Windows.Forms.DialogResult.None;

result = InputBox.Show(
    "Input Required",
    "Please enter the value (if available) below.",
    "Value",
    out output);

if (result != System.Windows.Forms.DialogResult.OK)
{
    return;
}

ध्यान दें कि यह प्रदर्शित करने के लिए आप कितने टेक्स्ट पर आधारित हैं, यह ऑटो के एक छोटे आकार को प्रदर्शित करता है। मुझे यह भी पता है कि इसमें घंटी और सीटी की कमी है, लेकिन यह इसी दुविधा का सामना करने वालों के लिए एक ठोस कदम है।


-2

ऐसी कोई बात नहीं है: मैं इसे अपने लिए लिखने और जब भी आपको आवश्यकता हो, इसका उपयोग करने की सलाह देता हूं।

हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.