Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Windows.Form in Custom Profile

Featured Replies

hi there,

 

like the title says i would like to instantiate a Windows.Form object in a Custom Profile. i tried it in an backgroundworker thread but it

still freezes the wrobot and crashes. any idea how i could do this ?

 

best regards

Hello,

 

Try it:

using System.Threading;
using System.Windows.Forms;
using Custom_Profile;

public class CustomProfile : ICustomProfile
{
    private Form _form;
    private bool _isStarted;
    public void Pulse()
    {
        _isStarted = true;

        var t = new Thread(OpenWinform);
        t.SetApartmentState(ApartmentState.STA);
        t.Start();
    }

    public void Dispose()
    {
        _isStarted = false;
        if (_form != null)
        {
            // Use BeginInvoke because it not called from winform thread.
            _form.BeginInvoke(new MethodInvoker(_form.Close));
            _form.BeginInvoke(new MethodInvoker(_form.Dispose));
        }
    }

    void OpenWinform()
    {
        _form = new Form();
        _form.Controls.Add(new Label { Text = "My window" });

        _form.ShowDialog();
    }
}

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.