electron中默认带有顶部菜单栏,有时候我们的应用不需要。

再main.js文件中设置

const electron = require('electron')

const path = require('path')
const url = require('url') let mainWindow
const Menu = electron.Menu
function createWindow () {
 // 隐藏菜单栏
  Menu.setApplicationMenu(null)
// Create the browser window.设置窗口宽高,最小宽高,图标等
mainWindow = new BrowserWindow({ width: 800, height: 600, minWidth: 1280, minHeight: 800, resizable: false, allowRunningInsecureContent: true, experimentalCanvasFeatures: true, icon: './favicon.ico'})
mainWindow.loadURL("http://www.nlfit.cn/saas/index.html#/login") mainWindow.on('closed', function () {
mainWindow = null
})
}
const electron = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
// const app = electron.app
// const BrowserWindow = electron.BrowserWindow
const path = require('path')
const url = require('url')
let mainWindow
const Menu = electron.Menu
function createWindow () {
Menu.setApplicationMenu(null)
// Create the browser window.
mainWindow = new BrowserWindow({ width: , height: , minWidth: , minHeight: , resizable: false, allowRunningInsecureContent: true, experimentalCanvasFeatures: true, icon: './favicon.ico'})
// and load the index.html of the app.
mainWindow.loadURL("http://www.nlfit.cn/saas/index.html#/login")
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}

如何隐藏electron窗体的菜单栏的更多相关文章

  1. SharePoint 2013 隐藏左边快速启动菜单栏(Hiding the Quick Launch Bar)

    在SharePoint 2013默认网站页面中,很多时候,我们需要隐藏左边快速启动菜单栏,这时我们可以通过下面的样式来实现隐藏它. 和SharePoint 2010不太一样,方法改了,不过性质是一样的 ...

  2. 求助(VC++) 隐藏Console窗体无效

    [逝去的100~~ 2014/10/07 20: 20] 程序想要实现控制台窗体的隐藏,可是窗体每次执行总会弹出来.为什么呢? 代码例如以下: // Mini.cpp : 定义控制台应用程序的入口点. ...

  3. electron+vue实现菜单栏

    公司开发的产品都是用c++写的,而且还都是几个人,老板想搞下创新,就是看看能否通过其它的方式来实现前后端分离.然后我就了解到了electron这个东西,之前学安卓的时候看到过flutter,不经意间看 ...

  4. C# WinForm下,隐藏主窗体的方法

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  5. 将现有vue项目基于electron打包成桌面应用程序

    一.前言 项目本来打算采用B/S架构去做的,浏览器网址方式打开还是让用户不方便: 二.使用electron集成桌面应用 本身项目是使用vue-cli开发的,在使用electron之前,需要将本身的项目 ...

  6. C# .NET 隐藏窗体

    隐藏窗体,打开窗体后如果想让它隐藏,然后再显示出来,就判断是不是NULL或者有没有关闭,不然就NEW一个出来,否则就SHOW出来. 当然如果有隐藏的话退出的时候最好用Application.Exit( ...

  7. Windows 窗体最小化和隐藏的区别及恢复

    应用程序有托盘图标,窗体最小化或者隐藏窗体时,点击托盘图标需要恢复窗体显示,并且恢复之前的现实状体,正常大小或者最大化显示.例如:最大化显示窗体时,点击最小化按钮,窗体最小化,点击托盘图标将最大化显示 ...

  8. 隐藏基于Dialog的MFC的主窗体

    最近需要做一个主窗体常态隐藏的程序,类似360卫士那样,只有托盘图标常显示.本以为隐藏主窗体很简单,但遇到了意想不到的情况. 无效的做法 最初的想法是设置主对话框资源的 Visiable 属性为 fa ...

  9. Windows Mobile X图标如何销毁窗体而非隐藏

    在Windows Mobile窗体上,有“OK”和“X”两种形式按钮.1.在Form的属性里,设置“MinimizeBox=false”,则窗体显示”OK”,点击该按钮窗体销毁并退出.2.设置“Min ...

随机推荐

  1. JAVA_the user operation is waiting怎么办

    彻底解决 MyEclipse出现the user operation is waiting的问题   2011-05-31 10:32:30|  分类: 软件编程 |  标签:java  myecli ...

  2. DosBox 报错 this program requires dosxnt.exe to be in your path

    也就是少了dosxnt.exe文件,能够上网搜索下载,把dosxnt 拷贝到你挂截文件夹下就能够执行 Dosxnt文件下载

  3. IDEA debug调式快捷键

    F9 resume programe 恢复程序 Alt+F10 show execution point 显示执行断点 F8 Step Over 相当于eclipse的f6 跳到下一步 F7 Step ...

  4. Codeforces 755 F. PolandBall and Gifts 多重背包+贪心

    F. PolandBall and Gifts   It's Christmas time! PolandBall and his friends will be giving themselves ...

  5. scala wordcount kmeans

    scala wordcount   kmeans k-means算法的输入对象是d维向量空间的一些点,对一个d维向量的点集进行聚类. k-means聚类算法会将集合D划分成k个聚簇.

  6. zTree 基本用法

    [简介] zTree 是利用 JQuery 的核心代码,实现一套能完成大部分常用功能的 Tree 插件 兼容 IE.FireFox.Chrome 等浏览器 在一个页面内可同时生成多个 Tree 实例 ...

  7. 什么是 jQuery EasyUI

    jQuery EasyUI 是一个基于 jQuery 的框架,集成了各种用户界面插件. jQuery EasyUI 框架提供了创建网页所需的一切,帮助您轻松建立站点. easyui 是一个基于 jQu ...

  8. easyUI下拉列表点击事件的使用

    可以通过input 和select来创建下拉列表 其中select的创建如下: 通过json来创建js数组 [{ "id":1, "text":"te ...

  9. [Codeforces 545E] Paths and Trees

    [题目链接] https://codeforces.com/contest/545/problem/E [算法] 首先求 u 到所有结点的最短路 记录每个节点最短路径上的最后一条边         答 ...

  10. BZOJ3160【万径人踪灭】 【FFT】

    ..恩 打了四五遍 不会也背出来了.. BZOJ3160 [听说时限紧?转C++的优势么?] 上AC代码 fft /*Problem: 3160 User: cyz666 Language: C++ ...