小编Cod*_*ick的帖子

如何自定义ToolTipService.ToolTip的模板?

Silverlight提供ToolTipService.ToolTip基本应用程序.

不过,我想自定义TemplateToolTip通过做这样的事情:

<TextBlock Text="Hello"  >
  <ToolTipService.ToolTip>
     <TextBlock Text="I can help you." />  <!--replace this with my template-->
  </ToolTipService.ToolTip>
</TextBlock>
Run Code Online (Sandbox Code Playgroud)

我想要能够动态设置的属性ContentStyle属性.ToolTipDataContext

这样的效果:

<TextBlock Text="Hello" Style="{StaticResource TextBlockWithToolTip}" />
Run Code Online (Sandbox Code Playgroud)

silverlight silverlight-3.0

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

jQuery UI叠加没有显示?

所有.我正在尝试使用叠加层来处理我的模态框.

如何创建工作叠加层?

我正在使用jQuery UI,并让它与叠加层分开工作.

以下是调用模块的代码:

function showDialog(){
    $("#example").dialog();
    return false;   
}

$(window).resize(function() {
    $("#example").dialog("center", "center", "center");
});
Run Code Online (Sandbox Code Playgroud)

如何调用叠加层?

如果单击以下网址中的链接显示对话框:

http://satbulsara.com/NSJ-LOCAL-02-06/eqs1.htm

谢谢,

星期六

jquery jquery-ui

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

无法找到类型或命名空间名称'...'(您是否缺少using指令或程序集引用?)

这项工作适用于我转移到这个应用程序的另一个应用程序.我已经被困在这里好几个小时了,谷歌没有太多的MEF.是的,导入了System.ComponentModel.Composition.dll.但仍然无法摆脱这个错误.

我有这个为我的包括:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.ComponentModel.Composition;
using JSNet;
Run Code Online (Sandbox Code Playgroud)

受影响的代码:

var catalog = new AggregatingComposablePartCatalog();
var mainAssemblyCatalog = new AttributedAssemblyPartCatalog(this.GetType().Assembly);
var jsNetCatalog = new AttributedAssemblyPartCatalog(typeof(Effect).Assembly);            
//var addInEffects = new DirectoryPartCatalog("Effects"); 

catalog.Catalogs.Add(mainAssemblyCatalog);
catalog.Catalogs.Add(jsNetCatalog);
//catalog.Catalogs.Add(addInEffects);
var container = new CompositionContainer(catalog);
Run Code Online (Sandbox Code Playgroud)

错误:

Error 1: The type or namespace name 'AggregatingComposablePartCatalog' could not be found (are you missing a using directive or an assembly reference?) 

Error 2: The type or namespace name 'AttributedAssemblyPartCatalog' could not be found (are you …
Run Code Online (Sandbox Code Playgroud)

c# mef

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

无法删除JavaScript隐藏的类

我想在加载时隐藏div并在单击按钮时显示它,但我得到的是div只显示一会儿并再次隐藏.我是否正确使用CSS类或者有什么特别之处display:none;

HTML


<div id="message">
    <div class="item-user hid">
        <a href="">something</a> 
    </div>

    <a class="btn-user" href="">button</a>
</div>
Run Code Online (Sandbox Code Playgroud)


CSS


.hid {
    display: none; 
}
Run Code Online (Sandbox Code Playgroud)


JS


<script>
    //jquery is loaded already

    $(document).ready(function(){

        $('#message .btn-user').click(function(){
            $('#message .item-user').removeClass('hid');
        });

    });
</script>
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery

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

在C++中存储引用变量

我一直在努力寻找以下两段代码之间的区别。

这 ...

int z=10;
int y=&z;
Run Code Online (Sandbox Code Playgroud)

...无效,而以下内容不会引发任何错误:

int& foo()
{
    int z=10;
    return z;
}
main()
{
    int y=foo();
    cout<<y;
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

当我尝试运行该程序时,它返回了y=10

我的问题是:

如果y使用可以存储另一个变量的引用foo(),为什么不直接使用y=&z呢?

c++ memory-management return return-type

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

选中复选框时如何突出显示整行

我有一个JSF数据表.我想在选中相应的复选框时突出显示该行.我如何编辑JavaScript代码来实现这种效果?

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"    
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <ui:insert name="header">           
            <ui:include src="header.xhtml"/>         
        </ui:insert>
        <script type="text/javascript" src="resources/js/jquery-1.7.2.min.js"></script>
    </h:head>
    <h:body>

        <h1><img src="resources/css/images/icon.png" alt="NVIDIA.com" /> History Center</h1>
        <!-- layer for black background of the buttons -->
        <div id="toolbar" style="margin: 0 auto; width:1180px; height:30px; position:relative;  background-color:black">
            <!-- Include page Navigation -->
            <ui:insert name="Navigation">           
                <ui:include src="Navigation.xhtml"/>         
            </ui:insert>

        </div>  

        <div id="greenBand" class="ui-state-default ui-corner-allh" style="position:relative; top:35px; left:0px;"> 
            <h:graphicImage alt="Dashboard"  style="position:relative; top:-20px; left:9px;"  value="resources/images/logo_sessions.png" /> …
Run Code Online (Sandbox Code Playgroud)

html javascript java jquery jsf-2

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

一个列表中有更多不同的项目

我想列出包含不同项目或我应该称之为的列表.我的意思是例如.

public class form1
{
    public List<string> information = new List<string>();
}
Run Code Online (Sandbox Code Playgroud)

我希望它包含来自文本框的信息,ID,名称和语音如下:

private void btnForm_Click(object sender, EventArgs e)
{
    Form2 Form1= new Form2(); 

    Form1.Show();

    class Form2a = new Form2();
    a.information.Add(txtId.Text);
    a.information.Add(txtName.Text);
    a.information.Add(txtPhonenumber.Text);
}
Run Code Online (Sandbox Code Playgroud)

然后它将充满我们可以称为具有不同Id,名称和语音的不同客户.

然后我想将信息提供给另一种形式.

有人可以帮助我或给我如何提示吗?

c# items list

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

参数化查询''需要参数'',这是未提供的

我正在构建一个使用ObjectDataSource的应用程序.我希望我的所有患者详细信息都显示在GridView中,一旦用户选择其中的记录,我想在详细信息视图中显示特定记录的数据.

但是我有一个错误 getPatientFullDetailsbyPPS

参数化查询'(@PPS nvarchar(4000))选择*来自患者,其中PPS = @PPS'需要参数'@PPS',这是未提供的.

C#:

public static Patient GetPatientFullDetailsByPPS(string PPS)
{
    Patient patient = new Patient();

    //string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

    using (SqlConnection con = new SqlConnection(GetConnectionString()))
    {
        SqlCommand cmd = new
        SqlCommand("Select * from Patients where PPS = @PPS", con);
        SqlParameter parameter = new SqlParameter();
        parameter.ParameterName = "@PPS";
        parameter.Value = PPS;
        cmd.Parameters.Add(parameter);
        con.Open();
        SqlDataReader dr = cmd.ExecuteReader(); --------> error here
        while (dr.Read())
        {
            patient.PPS = dr["PPS"].ToString();
            patient.Surname = dr["Surname"].ToString();
            patient.Name = dr["Name"].ToString();
            patient.DOB …
Run Code Online (Sandbox Code Playgroud)

c# asp.net gridview objectdatasource detailsview

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

如何移动多个div框的背景?

在我的脚本中似乎有一个问题,我无法弄清楚它可能是什么......

这是JSfiddle

我正试图改变多个div框的背景.Evey生成第二个随机数,如果弹出正确的数字,则随机选择其中一个div并将其背景移位100px.如果该div上的背景已经移位,它将恢复到其原始状态.


JavaScript的


div = document.getElementById('time');
write = document.getElementsByClassName('write');
data = [0, 0, 0, 0];
setInterval(function () {
var num = Math.floor(Math.random() * 2);
div.innerHTML = num;
if (num == 1) {
    n = Math.floor(Math.random() * 4);
    if (data[n] = 0) {
        write[n].style.backgroundPosition = '0px 100px';
        data[n] = 1;
    } else {
        write[n].style.backgroundPosition = '0px 0px';
        data[n] = 0;
    }
}
}, 1000);
Run Code Online (Sandbox Code Playgroud)


CSS


.write {
    width: 100px;
    height: 100px;
    background: url('http://daokun.webs.com/back.png');
    -webkit-transition: all 1.5s cubic-bezier(.08, …
Run Code Online (Sandbox Code Playgroud)

html javascript

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

如何验证具有上,下和特殊字符的密码?

我需要验证用户需要设置最小值,1个上限,1个下限和1个特殊字符...我只是验证用户需要最少6个字母或更多...

try
{
    string actualPass = this.txtactualPass.Text;
    string newPass = this.txtnewPass.Text;
    string reEnterPass = this.txtReEnterPass.Text;

    if (actualPass == this.Session["password"].ToString())
    {
        if (newPass.Length >= 6)
        {
Run Code Online (Sandbox Code Playgroud)

c# asp.net

-1
推荐指数
1
解决办法
5047
查看次数