问题列表 - 第14290页

我是如何在WinForm应用程序中实现应用程序范围的颜色代码的?

我正在构建一个WinForms应用程序,我在大多数控件上使用特定的颜色.我有时从WinForms设计师那里做,有时直接进入我的代码.

我有一个静态类看起来像这样:

 public static class MyColors
    {
        public static Color DarkGreen = Color.FromArgb(0, 70, 62);
        ...
        public static Color Orange = Color.FromArgb(239, 132, 16);

    }
Run Code Online (Sandbox Code Playgroud)

我可以很容易地在代码中使用这些颜色,但是设计师无法做到这一点,这会引发这个错误:

MyColors.DarkGreen不是Int32的有效值.

(我试图存储这些颜色的Int32表示,但是失败并出现相同的错误)

我现在使用的解决方案是在设计器中使用rgb颜色代码,在我的代码中使用MyColors类值,并且我正在使用Visual Studio的替换所有功能进行更改.这不是一个好的解决方案,但到目前为止我还没有找到更好的想法.

有任何想法吗 ?


注意:我知道这个问题,与我的略有不同,因为我不打算改变"KnownColors".

.net colors skinning winforms

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

以确定的顺序在tomcat中启动webapps

我有2个webapps:

WebApp 2取决于WebApp 1

如果WebApp 1未运行,则WebApp 2将失败

我可以在tomcat中定义我总是希望webapp 1在webapp 2之前启动吗?

tomcat web-applications server.xml

10
推荐指数
1
解决办法
5847
查看次数

递归调用返回一个List,返回类型导致我的问题

我有一个递归方法,它返回我的类别,并检查其子类别.

所以它看起来像:

public List<Category> GetAllChildCats(int categoryid)
{
      List<Category> list = new List>Category>();

      Category c = Get(categoryid);

      foreach(Category cat in c.ChildCategories)
      {
              list.Add( GetAllChildCats(cat.CategoryID) )

      }

}
Run Code Online (Sandbox Code Playgroud)

这失败了,因为对list.add的调用需要一个Category对象,但它又返回另一个List,我应该如何解决这个问题呢?

c# recursion

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

AS3:如何将ascii代码转换为字符动作脚本

我想从画布创建一个棋盘类,它允许跟踪像A2这样的坐标上的点击位置,其中A ... D是某个比例的Y坐标,1 ... 3是X坐标

例如,见图片http://img.skitch.com/20091001-k6ybfehid6y8irad36tbsiif15.jpg

我想要创建的是一种从canvas localX和localY到我的新坐标(如A2)的转换器.

我正在考虑以这种方式实施条件

if   (0.4 - x*size(from 1-3 here)/canvas.width <= X <= 0.4 + x*size(from 1-3 here)/canvas.width)
       X = x;
Run Code Online (Sandbox Code Playgroud)

这样我就可以在X范围内分配所需的坐标.例如1,2,3等

但是如何处理字母数字范围.(例如,我想让它可扩展)...

也许有一种方法可以将ASCII转换为char?PLS.建议你的解决方案

apache-flex actionscript-3

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

如何评估搜索引擎?

我是一名学生,正在进行一项研究,以增强搜索引擎的现有算法.

我想知道如何评估搜索引擎 - 我已经改进了 - 来量化算法的改进程度.

我该如何比较旧算法和新算法?

谢谢

seo search-engine pagerank

8
推荐指数
2
解决办法
6684
查看次数

php函数转换卷曲引号和em破折号成"和 -

有没有人有一个函数将转换卷曲引号和em破折号转换为"和 - ?

我已经尝试过编写一个但是当它从MS字体复制到textarea时失败了.

谢谢

php function

0
推荐指数
1
解决办法
811
查看次数

Android:使用带有setOnClickListener/onClick的SWITCH语句超过1个按钮?

假设我在LinearLayout中有几个按钮,其中2个是:

mycards_button = ((Button)this.findViewById(R.id.Button_MyCards));
exit_button = ((Button)this.findViewById(R.id.Button_Exit));
Run Code Online (Sandbox Code Playgroud)

我注册setOnClickListener()了他们两个:

mycards_button.setOnClickListener(this);
exit_button.setOnClickListener(this);
Run Code Online (Sandbox Code Playgroud)

如何使SWITCH区分Onclick中的两个按钮?

public void onClick(View v) {
  switch(?????){
    case ???:
      /** Start a new Activity MyCards.java */
      Intent intent = new Intent(this, MyCards.class);
      this.startActivity(intent);
      break;
    case ???:
      /** AlerDialog when click on Exit */
      MyAlertDialog();
      break;
}
Run Code Online (Sandbox Code Playgroud)

android button listener

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

Apache Camel Spring配置错误 - 无法找到XML架构命名空间的Spring NamespaceHandler [http://camel.apache.org/schema/spring]

我已经从我的spring.xml文件和我正在获得的堆栈跟踪中发布了一段摘录.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang"
    xmlns:util="http://www.springframework.org/schema/util" xmlns:jaxws="http://cxf.apache.org/jaxws"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
    http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
    http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring-2.0.0.xsd"
    default-init-method="init" default-lazy-init="false">

    <!-- import web service configuration -->
    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
        <package>com.testdomain.testpackage</package>
    </camelContext>
...
</beans>
Run Code Online (Sandbox Code Playgroud)

这引发了这个异常:

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://camel.apache.org/schema/spring]
Offending resource: class path resource [spring-config.xml]

    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) …
Run Code Online (Sandbox Code Playgroud)

spring web-applications apache-camel

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

你在哪里画"嵌入"和"嵌入"之间的界限?

ASIDE:是的,这可以被认为是一个主观问题,但我希望从答复的统计数据中得出结论.

有广泛的计算设备.它们的物理尺寸,计算能力和电力范围都很大.我想知道嵌入式开发人员认为什么是使系统"嵌入"的决定性因素.我有自己的决心,我将保留一个星期,以免影响答复.

embedded

12
推荐指数
3
解决办法
547
查看次数

Mysqli参数绑定问题

我需要额外的一双眼睛.任何帮助将不胜感激.这是一个非常简单的搜索查询,但无论出于何种原因,我找不到该错误.好吧,我知道bug在哪里.我只是无法超越它.无论如何.....

我从POST变量中获取搜索值,设置该变量,然后按如下方式设置列变量...

$term = "'%".$_POST['searchTerm']."%'";
$field = "columnName";
Run Code Online (Sandbox Code Playgroud)

当我回应这些时,它们会完美地出现.因此,如果我在表单中键入"a",我将回显'%a%'和columnName.

然后我准备查询并绑定参数如下...

$suquery=$dbCon->prepare("select * from Table where ? LIKE ?");
$suquery->bind_param('ss', $field, $term);
$suquery->execute();
Run Code Online (Sandbox Code Playgroud)

结果总是返回0行.我发现,当我玩这个时,没有绑定参数正常工作,即使它应该如此回应.例如,当我更改查询以便列被硬编码并且仅绑定搜索项时....

$suquery=$dbCon->prepare("select * from Table where columnName LIKE ?");
$suquery->bind_param('s', $term);
$suquery->execute();
Run Code Online (Sandbox Code Playgroud)

我仍然得到零返回的行.这告诉我,即使$ field回声为'%a%',某些东西仍然没有关闭.我真的很茫然.同样,当我硬连接搜索词并绑定列时......

$suquery=$dbCon->prepare("select * from Table where ? LIKE '%a%'");
$suquery->bind_param('s', $field);
$suquery->execute();
Run Code Online (Sandbox Code Playgroud)

我得到了太多的行返回.它实际上从表中拉出行,其中任何列中的值包含字母"a".因此,列或术语都没有正确绑定.劳动节!

php mysql mysqli parameterbinding sql-like

4
推荐指数
1
解决办法
2987
查看次数