none
Visual Studio for Mac preview: Get a button click.

    Question

  • I downloaded Visual Studio for Mac preview and am trying to make a Mac program.

    I added a button the the form and I would like to get the button clicked event.

    I just can't figure it out.

    So does anybody know how to do it?


    Trisect Development

    Tuesday, December 06, 2016 8:18 PM

Answers

All replies

  • Hi Trisect,

    The .Net Core is cross platform though it doesn't include winform or Wpf. Maybe it will in the future

    You can use Xamarin Studio and Mono to make a winform app for mac, though if you want to to use Visual Studio buy Xamarin business license for VS support or make a XNA or a web app. See my answer here .net core for linux and mac for more info.

    Best regards,

    Kristin


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Kristin Xie Wednesday, December 07, 2016 7:01 AM
    Wednesday, December 07, 2016 7:01 AM
  • I'm not trying to make a Winform, but an Mac program with button on it.

    Well there is a storyboard in my project and when I click on it it opens Xcode.

    I then place a button, make a click event and save the file.

    Now in the viewcontroller.designer.cs file I have this code:

            [Action ("klikmig:")]
            partial void klikmig (AppKit.NSButton sender);

    So my question is how do I make a method in the viewcontroller.cs file so that the Klikmig can get called?


    Trisect Development

    Wednesday, December 07, 2016 7:12 AM
  • Hi my friend,

    Welcome to the MSDN forum.

    Refer to your description, this issue is about the development of Mac program. Since our forum is to discuss Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor, I will move this thread to Using Forums >Where is the Forum For…?to help you find an appropriate forum which can help you to get a more professional support, thank you for your understanding.

    Meanwhile, you can have a look at this documentand it looks like describes some common usages for mac program, it may be helpful for your question.

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, December 08, 2016 9:10 AM
  • You don't understand what I want.

    I want to make a Mac program in the new Visual Studio for Mac preview. I want to learn how to use this tool. That why I asked you how do I detect a button click.

    I DONT want to make a Mac program in Xcode I know Xcode already, I want to make it in Visual Studio for Mac preview.

    In Visual Studio for Mac preview you can select to create a Mac program, and that is what I did.

    Now the only thing I ask is how to detect a button click in this tool, but you won't tell me.

    Great way to get people starting to use Visual Studio for Mac.


    Trisect Development

    Thursday, December 08, 2016 9:17 AM
  • I'd probably try them over here.

    https://forums.xamarin.com/

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Thursday, December 08, 2016 1:47 PM
    Moderator