小编Mik*_*ike的帖子

你调用的对象是空的.

我运行程序时不断收到此错误.

你调用的对象是空的.描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.异常详细信息:System.NullReferenceException:未将对象引用设置为对象的实例.

Source Error:

Line with error:

Line 156:        if (strSearch == "" || strSearch.Trim().Length == 0)
Run Code Online (Sandbox Code Playgroud)

它的正确写法是什么?

c#

76
推荐指数
4
解决办法
89万
查看次数

在vba中编写VLOOKUP函数

我正在尝试使用我的vba代码中的VLOOKUP函数在表数组中的电子表格中查找值.我不知道怎么写得正确.

这是包含所有引用的普通VLOOKUP公式:

=VLOOKUP(DATA!AN2,DATA!AA9:AF20,5,FALSE)
Run Code Online (Sandbox Code Playgroud)

excel vba

27
推荐指数
3
解决办法
30万
查看次数

检查输入的数字是否为奇数

`我不确定要插入什么代码甚至在哪里,但我想检查我输入的数字是一个奇数.

import java.io.*;
import javax.swing.JOptionPane;

public class Diamond {
    public static void main(String [] args) throws IOException {

        BufferedReader stdin = new BufferedReader (new InputStreamReader (System.in));
        String input; 
        int num;
        System.out.println("input number: ");
        input = stdin.readLine ();
        num = Integer.parseInt(input);

        if (num % 2 ==1){
            int d = num;
            int e = 0;
            for (int a = 0; a <= num; a++) {
                for (int c = d; c>= 1; c-- )
                    System.out.print(" ");
                d-=1;
                for (int b = 1; …
Run Code Online (Sandbox Code Playgroud)

java java-io

13
推荐指数
3
解决办法
8万
查看次数

更改JFrame标题

这段代码编译,我只是无法在标题栏上更改名称.

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;  
import java.awt.event.ActionListener;  
import javax.swing.JButton;  
import javax.swing.JFrame;  
import javax.swing.JLabel;  
import javax.swing.JPanel;  
import javax.swing.JTabbedPane;  
import javax.swing.JTextArea;  
import javax.swing.JTextField;  
public class VolumeCalculator extends JFrame implements ActionListener  
{  
    private JTabbedPane jtabbedPane;  
    private JPanel options;  
    JTextField poolLengthText, poolWidthText, poolDepthText, poolVolumeText, hotTub,  
            hotTubLengthText, hotTubWidthText, hotTubDepthText, hotTubVolumeText, temp, results,
            myTitle;  
    JTextArea labelTubStatus;  
    public VolumeCalculator()  
    {  
        setSize(400, 250);  
        setVisible(true);  
        setSize(400, 250);  
        setVisible(true);  
        setTitle("Volume Calculator");  
        setSize(300, 200);  
        JPanel topPanel = new JPanel();  
        topPanel.setLayout(new BorderLayout());  
        getContentPane().add(topPanel);  

        createOptions();  

        jtabbedPane = new JTabbedPane();  

        jtabbedPane.addTab("Options", options);  

        topPanel.add(jtabbedPane, BorderLayout.CENTER); …
Run Code Online (Sandbox Code Playgroud)

java eclipse jframe

11
推荐指数
2
解决办法
12万
查看次数

删除列表框上的滚动条

我在vba中使用userForm,我有一个列表框.我想删除horoz.滚动条从底部.有没有办法做到这一点?我没有在属性框中看到任何选项.

在此输入图像描述

excel vba userform

7
推荐指数
1
解决办法
3万
查看次数

有没有办法一次禁用多个按钮?

我有一个vba userForm,上面有36个按钮.当我的某个传感器上的值达到一定数量时,我想禁用所有按钮.现在,每按一次按钮,我正在引用的电子表格上的数字就会增加一个.当数字达到三时,我想禁用所有按钮.

excel vba userform

6
推荐指数
2
解决办法
5301
查看次数

System.NotImplementedException错误

我正在使用ASP.NET 3.5.我做了一个表单,当用户点击一个按钮时,它应该在另一个页面上添加有关它的信息.而不是加载我得到这个错误页面:

The method or operation is not implemented. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NotImplementedException: The method or operation is not implemented.

Source Error: 

    public static dsPersonnel GetPersonnel(string p)
    {
       throw new NotImplementedException();
    } 

Source File:    Line: 203 
Run Code Online (Sandbox Code Playgroud)

我不确定我需要在这里发布什么才能提供足够的帮助信息.

这是错误可能出现的代码.我想我可能有一些不合适的地方:

    public clsDataLayer()
    {

    }

    // This function gets the user activity from …
Run Code Online (Sandbox Code Playgroud)

c#

5
推荐指数
1
解决办法
3万
查看次数

更改标题栏中的文本

我在这一行收到错误:无法解析jFrame

jFrame.setTitle(titleName.getText());





    public void createOption(){
        Option = new JPanel();
        Option.setLayout( null );

         JLabel TitleLabel = new JLabel("Change the company name");
         TitleLabel.setBounds(140, 15, 200, 20);
         Option.add(TitleLabel);
         titleName = new JTextField();
         titleName.setBounds(90,40,260,20);
           Option.add(titleName);

           JButton Change = new JButton("Change New Name");
           Change.setBounds(90,80,150,20);
           Change.addActionListener(this);
           Change.setBackground(Color.white);
           Option.add(Change);

           JButton Exit = new JButton("Exit");
           Exit.setBounds(270,80,80,20);
           Exit.addActionListener(this);
           Exit.setBackground(Color.white);
           Option.add(Exit);

           Change.addActionListener(new ActionListener() { 

                public void actionPerformed(ActionEvent arg0) { 
                    jFrame.setTitle(titleName.getText()); 

                } 
            });

}
Run Code Online (Sandbox Code Playgroud)

java user-interface

3
推荐指数
1
解决办法
1万
查看次数

.aspx代码错误"不支持元素'xxxx'."

我的图像按钮,链接按钮,文本框和标签都出现了一堆错误.这些错误在我的.aspx代码中.我为什么这么多?

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="frmSearchPersonnel.aspx.cs" Inherits="frmSearchPersonnel" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head id="Head1" runat="server"> 
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 

    <div align="center"> 


    </div> 

    </div> 
    <asp:Label ID="Label1" runat="server" Text="Search for employee by last name"></asp:Label> 
    <asp:TextBox ID="txtSearchName" runat="server"></asp:TextBox> 
    <p> 
        <asp:Button ID="btnSearch" runat="server" PostBackUrl="~/frmViewPersonnel.aspx"  
            Text="Search" onclick="btnSearch_Click" /> 
    </p> 
    </form> 
</body> 
</html>.
Run Code Online (Sandbox Code Playgroud)

错误位于上面的Label,TextBox和Button下面.错误状态:

验证():不支持元素'xxxx'.

c# asp.net

3
推荐指数
2
解决办法
1万
查看次数

分裂一个字符串

我想取下面的代码并将我输入的5个数字字符串放入框中,并在每个数字之间输出5个空格.所以我可以进入12345,输出就是1 2 3 4 5.

我不知道如何做到这一点,或者在哪里插入代码.

String number;

while (true)
{
number = JOptionPane.showInputDialog("Enter Number");       

if(number.length() >5 )
{
JOptionPane.showMessageDialog(null,"Please enter a 5 digit number!","Try again",
        JOptionPane.PLAIN_MESSAGE);
    }
else break;
}
JOptionPane.showMessageDialog(null,"The new result is " + number,"Results",
        JOptionPane.PLAIN_MESSAGE);

        System.exit(0);
Run Code Online (Sandbox Code Playgroud)

谢谢

java split

2
推荐指数
1
解决办法
404
查看次数

标签 统计

java ×4

c# ×3

excel ×3

vba ×3

userform ×2

asp.net ×1

eclipse ×1

java-io ×1

jframe ×1

split ×1

user-interface ×1