c# - DataSource (object) not bind to textbox -


i new vb , visual studio. followed online tutorial binding. can not click text property of advanced binding page, following. not sure what information necessary debug. so, post creenshot here. questions. please let me know. code of class used datasource:

public class miconfig     public m_name string     public m_primary integer     public sub new(byval name string, byval primary integer)         m_name = name         m_primary = primary     end sub end class   'textbox1 ' me.textbox1.location = new system.drawing.point(3, 193) me.textbox1.name = "textbox1" me.textbox1.size = new system.drawing.size(120, 26) me.textbox1.tabindex = 3 

enter image description here

enter image description here

update

why down-voted, please leave comment or solution or anything? otherwise, down-voting cannot improve society.

enter image description here

  1. mark class datasource
    advanced binding(window in screenshot) -> binding -> add project datasource -> object -> select class
  2. select property of class in binding want use data-binding
    property bounded textbox.text property default

for data-binding need have properties in class, @ moment class contains fields

public class miconfig     public property name string     public property primary integer     public sub new(byval name string, byval primary integer)         me.name = name         me.primary = primary     end sub end class 

if have trouble use data-binding through designer, try in code

public class myform     private _bindingmodel miconfig      public sub new(model miconfig)         me.initializecomponent()          _bindingmodel = model         textbox1.databinding.add("text", _bindingmodel, "m_name", true)      end sub  end class 

Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -