开发者

Creating child window and passing data from it to parent window

开发者 https://www.devze.com 2023-04-02 15:16 出处:网络
I\'m building a private application so I won\'t be able to provide much info. but here it goes, I have a main window which have some elements that user chooses from.

I'm building a private application so I won't be able to provide much info.

but here it goes, I have a main window which have some elements that user chooses from.

According to the choice another window opens. In this second window (child window) some fields are available.

Now here is what I need to do.

1) When the child window is opened, I need the parent one to be disabled until the child is closed. (I have the window already set as child by parent is not disabled and multiple child windows can be opened!!) ...

2) On the child window, one of the fields will be a date/time field which I'm thinking of building a custom date/time picker (can do this no problem here), but what I want to do is when user clicks on this specific field, I want a child window to appear cont开发者_JAVA百科aining my custom date/time picker, disabling the previous one but doesn't hide it, and when a btn is clicked, the data is sent to the parent in a specific format "dd/mm/yyyy hh:mm:ss AM/PM"


David's answer for your first question is correct just use ShowDialog. For your 2nd question, just put your custom control in another form and add a read only string property to the form that formats the value of the DateTime in your desired format using the .ToString(formatstring) overload


  1. That's just a modal form. Invoke it with ShowDialog.
  2. I can't answer that, but you did ask two questions at once.
0

精彩评论

暂无评论...
验证码 换一张
取 消