弹出框怎么写
- 综合知识
- 关注:2.61W次
(说明:属性设置窗口默认在屏幕右侧)
1.窗口名称:单击窗体,更改窗体的Caption属性。
窗口的小图标:单击窗体,设置窗体的Icon属性。
生成可执行文件的图标等详细信息:点菜单“工程 - 工程1 属性”,但后选“生成”选项卡,在里面设置。
2.单击输入框,把Appearance属性改为0。
3.透明的?VB自带的按钮控件不能设置为透明……你的意思是要在程序运行的时候不显示该按钮吗?单击按钮,把Visible属性改为False。
4.粗略控制:在右下角的“窗体布局”窗口中拖动你的窗体到合适的位置即可。
精确控制:单击窗体,设置窗体的StartUpPosition属性。
5.你的意思是去掉Windows风格的边框吗?单击窗体,把BorderStyle属性改为0。
6.请先自行设置“提示性文字”,即输入框的Text属性,然后双击输入框跳转到代码编辑窗口。往上看,你会看到两个下拉菜单,左面的是“对象”,显示Text1;右面的是“过程”,显示Change。单击“过程”下拉菜单,选择GotFocus过程,输入如下代码:(假设你的输入框名称为Text1)
Text1.Text = ""
在Click事件里写是不准确的,当按Tab键使输入框获得焦点的时候是无效的。
以上内容全部原创,希望能够帮得到你,也请后回答者不要抄袭。
2. 弹出窗口的html的代码是怎么写的1、最基本的弹出窗口代码
< SCRIPT LANGUAGE="javascript">
< !--
window.open ("page.html")
-- >
< /SCRIPT>
window.open ("page.html") 用于控制弹出新的窗口page.html,如果page.html不与主窗口在同一路径下,前面应写明路径,绝对路径(", "newwindow", "height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
->
< /SCRIPT>
< SCRIPT LANGUAGE="javascript"> js脚本开始;window.open 弹出新窗口的命令;"page.html" 弹出窗口的文件名;"newwindow" 弹出窗口的名字(不是文件名),非必须,可用空"代替;
3、用函数控制弹出窗口
< script LANGUAGE="JavaScript">
< !--
function openwin() {
window.open ("page.html", "newwindow", "height=100, width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")
}
-->
< /script>
这里定义了一个函数openwin(),函数内容就是打开一个窗口。
4、同时弹出2个窗口
< script LANGUAGE="JavaScript">
< !--
function openwin() {
window.open ("page.html", "newwindow", "height=100, width=100, top=0, left=0,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")
window.open ("page2.html", "newwindow2", "height=100, width=100, top=100, left=100,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")
}
-->
< /script>
为避免弹出的2个窗口覆盖,用top和left控制一下弹出的位置不要相互覆盖即可。
5、主窗口打开文件1.htm,同时弹出小窗口page.html
< script language="javascript">
< !--
function openwin() {
window.open("page.html","","width=200,height=200")
}
-->
< /script>
3. android消息弹出框怎么写AlertDialog的构造方法全部是Protected的,所以不能直接通过new一个AlertDialog来创建出一个AlertDialog。
下面例子来自于android学习手册,android学习手册包含9个章节,108个例子,源码文档随便看,例子都是可交互,可运行,源码采用android studio目录结构,高亮显示代码,文档都采用文档结构图显示,可以快速定位。360手机助手中下载,图标上有贝壳要创建一个AlertDialog,就要用到AlertDialog.Builder中的create()方法。
使用AlertDialog.Builder创建对话框需要了解以下几个方法:setTitle :为对话框设置标题setIcon :为对话框设置图标setMessage:为对话框设置内容setView : 给对话框设置自定义样式setItems :设置对话框要显示的一个list,一般用于显示几个命令时setMultiChoiceItems :用来设置对话框显示一系列的复选框setNeutralButton :普通按钮setPositiveButton :给对话框添加"Yes"按钮setNegativeButton :对话框添加"No"按钮create : 创建对话框show :显示对话框一、简单的AlertDialog下面,创建一个简单的ALertDialog并显示它:public class Dialog_AlertDialogDemoActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Dialog alertDialog = new AlertDialog.Builder(this). setTitle("对话框的标题"). setMessage("对话框的内容"). setIcon(R.drawable.ic_launcher). create(); alertDialog.show(); } } package com.tianjf;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.os.Bundle;public class Dialog_AlertDialogDemoActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Dialog alertDialog = new AlertDialog.Builder(this). setTitle("对话框的标题"). setMessage("对话框的内容"). setIcon(R.drawable.ic_launcher). create(); alertDialog.show(); }}运行结果如下:二、带按钮的AlertDialog上面的例子很简单,下面我们在e79fa5e98193e58685e5aeb931333361326235这个AlertDialog上面加几个Button,实现删除操作的提示对话框[java] package com.tianjf; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; public class Dialog_AlertDialogDemoActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Dialog alertDialog = new AlertDialog.Builder(this). setTitle("确定删除?"). setMessage("您确定删除该条信息吗?"). setIcon(R.drawable.ic_launcher). setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }). setNegativeButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }). setNeutralButton("查看详情", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }). create(); alertDialog.show(); } } package com.tianjf;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.content.DialogInterface;import android.os.Bundle;public class Dialog_AlertDialogDemoActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Dialog alertDialog = new AlertDialog.Builder(this). setTitle("确定删除?"). setMessage("您确定删除该条信息吗?"). setIcon(R.drawable.ic_launcher). setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }). setNegativeButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }). setNeutralButton("查看详情", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }). create(); alertDialog.sho。
4. java中要在弹出框中做判断怎么写import javax.swing.JOptionPane;
public class Test {
public static void main(String[] args) {
int result = JOptionPane.showConfirmDialog(null, "hello");
switch (result) {
case JOptionPane.YES_OPTION:
JOptionPane.showMessageDialog(null, "你选择了yes");
break;
case JOptionPane.NO_OPTION:
JOptionPane.showMessageDialog(null, "你选择了no");
break;
case JOptionPane.CANCEL_OPTION:
JOptionPane.showMessageDialog(null, "你选择了cancel");
break;
default:
JOptionPane.showMessageDialog(null, "你没选择");
break;
}
}
}
5. JS弹出对话框怎么写【1、最基本的js弹出对话框窗口代码】这是最基本的js弹出对话框,其实代码就几句非常简单:复制代码代码如下:因为这是一段javascripts代码,所以它们应该放在之间。
<!-- 和-->是对一些版本低的浏览器起作用,在这些老浏览器中不会将标签中的代码作为文本显示出来。要养成这个好习惯啊。
window.open ("page.html") 用于控制弹出新的窗口page.html,如果page.html不与主窗口在同一路径下,前面应写明路径,绝对路径(>
<body onl oad="openwin()"> 。任意的页面内容。