Home > Net >  C # access to user controls the value of the form
C # access to user controls the value of the form

Time:11-08

My main form for Form1, frmMessgeBox custom again a form to make it play the style of the window, frmMessgeBox calling a I create user controls myRadioButton, myRadioButton again call third-party radio button user controls UCBtnsGroups, when I chose UCBtnsGroups frmMessgeBox created a radio, when I click on frmMessgeBox form "was", DialogResult. Yes, closes frmMessgeBox form, this time in the main window Form1 how UCBtnsGroups selected value,
It very round, directly above:
This is my main project, contains Form1, and pop-up window: frmMessgeBox, and create user controls: myRadioButton

This is called the third party control repository HZHControls UCBtnsGroups radio user controls
Again this is my own calls in the user controls the third user controls UCBtnsGroups

This is what I call on frmMessgeBox form myRadioButton user controls


I want to in frmMessgeBox selection is now, shut down, in Form1 get UCBtnsGroups produce the value of the radio button selected items, how to obtain,

CodePudding user response:

I top, can't sink

CodePudding user response:

Public variables defined in frmMessageBox public string xx
Window is closed to his first assignment, withdraw his public reference function outside the value of the variable xx

CodePudding user response:

Understand, before too many dolls, I direct UCBtnsGroups controls will drag frmMessageBox forms, when frmMessageBox close access to its value

CodePudding user response:

FrmMessgeBox inside a save variables, click UCBtnsGroups radio when user controls keep the option value to a variable, and then the top one public function returns the variable's value, in Form1 form call frmMessgeBox defined interface functions,
FrmMessgeBox class definition:
Private int XXX;
Public int getXXX ()
{
Return XXX;
}
Inside the UCBtnsGroups radio event handler, to copy of XXX,
In Form1:
FrmMessgeBox form=new frmMessgeBox ()
Form the showDialog ();//show the form
.
Int=form XXX. GetXXX ();//for choice
  •  Tags:  
  • C#
  • Related