0

I am trying to call a form designed in SharpDevelop within another IDE. I get the following error message: 'TextBox' object has no attribute 'text'. This happens when I run the script which includes the lines shown below in the other IDE. Is the problem in the script itself or in the Form1 class written in SharpDevelop? How can I resolve this?

import myform
import System

f = myform.Form1()
if f.ShowDialog() == System.Windows.Forms.DialogResult.OK:
    dx = f._directionx.text
    dy = f._directiony.text
    dz = f._directionz.text
    nb = f._nbofiterations.text
    w = f._width.text
    h = f._height.text
Arthur Mamou-Mani
  • 2,303
  • 10
  • 43
  • 69

2 Answers2

3

Since it appears that you're using IronPython (the System.Windows.Forms gave it away) I'm guessing that your TextBox is a Forms element.

If this is so, you need the .Text property - everything (properties, functions/methods that I know of) in the .NET library starts with an uppercase letter.

Wayne Werner
  • 49,299
  • 29
  • 200
  • 290
-1

change .text to .Text dx = f._directionx.Text and so on C sharp is case sensitive language

  • 1
    in what way does that add anything, it is less clear but contains the same content as the accepted answer. – luk2302 Jun 08 '17 at 20:19