Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

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.

Empfohlene Antworten

Veröffentlicht

Hi,

Ich habe ein dynamisches Menu erstellt, dieses wird aber nicht angezeigt!

Der Programmcode lautet:


using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;


namespace WindowsFormsApplication1

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }


        private void Form1_Load(object sender, EventArgs e)

        {


        }


        public void AddContextMenu() 

        {

            ContextMenu cMenu = new ContextMenu();

            this.ContextMenu = cMenu;

            MenuItem mItem_new = new MenuItem();

            MenuItem mItem_open = new MenuItem();

            mItem_new.Text = "&New File";

            mItem_open.Text = "&Open File";

            MenuItem mItem_close = new MenuItem();

            mItem_close.Text = "&Close Programme";

            mItem_new.MenuItems.Add(mItem_close);

        }

    }

}

Ich hoffe, ihr könnt mir helfen!

Mit freundlichen Grüßen

mustiwebp

Ich weiß zwar nicht wieso, aber du wirst schon wissen warum ^^


public partial class Form1 : Form

    {


        ContextMenu cMenu;

        MenuItem mItem_new;

        MenuItem mItem_open;

        MenuItem mItem_close;


        public Form1()

        {

            InitializeComponent();

            AddContextMenu();

        }


        public void AddContextMenu()

        {

            cMenu = new ContextMenu();

            mItem_new = new MenuItem();

            mItem_open = new MenuItem();

            mItem_close = new MenuItem();

            mItem_new.Text = "&New File";

            mItem_open.Text = "&Open File"; 

            mItem_close.Text = "&Close Program";

            cMenu.MenuItems.Add(mItem_new);

            cMenu.MenuItems.Add(mItem_open);

            cMenu.MenuItems.Add(mItem_close);

            this.ContextMenu = cMenu;

        }

    }

Du wolltest doch n Kontextmenü, klicke mal rechts aufs Form und überleg mal warum da was auftaucht.

Und schau dir mal n paar Grundlagenbücher an bevor du fragst, warum nichts passiert wenn man aud die Knöpfe drückt^^

(Ist nichtmal böse gemeint, auch wenns so rüberkommt)

  • Autor

Hi,

Wenn ich rechts klicke funktioniert es!

Du hast Recht, ich kenne den Unterschied nicht!^^

Eigentlich wollte ich ein Menü oben wie beim Browser haben. Wie stelle ich das an?

Ich bedanke mich im Vorraus!

Mit freundlichen Grüßen,

mustiwebp

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.