在下面的代码中,我试图通过鼠标滚轮缩放图像。但是代码不能正常工作,它只是刷新面板但没有调整它的大小。实际上,我正在从另一个称为解密的类创建的内存流中获取图像。完整图像显示正确,但我无法使用鼠标滚轮事件执行图像缩放。请帮助我。
private void Form2_Load(object sender, EventArgs e)
{
this.Width = Screen.PrimaryScreen.WorkingArea.Width;
this.Height = Screen.PrimaryScreen.WorkingArea.Height;
this.CenterToScreen();
PicturePanel= new PictureBox();
PicturePanel.Dock = DockStyle.Fill;
//PicturePanel.SizeMode = PictureBoxSizeMode.AutoSize;
//PicturePanel.SizeMode = PictureBoxSizeMode.CenterImage;
PicturePanel.Focus();
//PicturePanel.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.OnMouseWheel);
this.Controls.Add(PicturePanel);
View_codee v = new View_codee();
try
{
PicturePanel.Image = Image.FromStream(Decrypt.ms1);
}
catch (Exception ee)
{
MessageBox.Show(ee.Message);
}
this.Name = "";
}
protected override void OnMouseWheel(MouseEventArgs mea)
{
// Override OnMouseWheel event, for zooming in/out with the scroll wheel
if (PicturePanel.Image != null)
{
// If the mouse …Run Code Online (Sandbox Code Playgroud) One interviewer asked this question to me ,when I am checking it's working how it is possible to check type of char and double? Please any one explain me.
class Program
{
static void Main(string[] args)
{
double d=0;
if((double)d == 'c')
{
Console.WriteLine("working");
}
else
{
Console.WriteLine("not");
}
Console.ReadLine();
}
}
Run Code Online (Sandbox Code Playgroud)
我有一个radibutton列表.
<asp:RadioButtonList ID="RadioButtonList1" runat="server"
RepeatDirection="Horizontal" RepeatLayout="flow" >
<asp:ListItem Selected="True" Text ="Yes" Value="0"></asp:ListItem>
<asp:ListItem Text ="No" Value="1"></asp:ListItem>
</asp:RadioButtonList>
Run Code Online (Sandbox Code Playgroud)
为了从无线电列表中获取值,我有一个功能:
function getvalueofradiolist() {
var radiolist = document.getElementById('<%= RadioButtonList1.ClientID %>');
var rblName = radiolist.name;
var radio = document.getElementsByName(rblName);
for (var x = 0; x < radio.length; x++) {
if (radio[x].checked) {
alert("Selected item Value " + radio[x].value);
}
}
}
Run Code Online (Sandbox Code Playgroud)
但它返回undefined.
我写错了吗?
我点击按钮调用此功能.
建议我如果我可以在Javascript的帮助下使用代码来做到这一点.
当我调用我的webservice方法时,我收到以下错误.
Origin http://localhost:4165 is not allowed by Access-Control-Allow-Origin.
Run Code Online (Sandbox Code Playgroud)
当引用网络我得到像添加的解决方案Access-Control-Allow-Origin
我不知道在哪里添加这个.我的脚本是:
$(document).ready(function () {
$.ajax({
type: "Post", dataType: "json", contentType: "application/json; charset=utf-8",
url: "http://localhost:63384/ListWebService.asmx/HelloWorld", success: function (data) { alert(data.d); }, error: function (request, status, error) {
alert(request.responseText);
}
});
});
Run Code Online (Sandbox Code Playgroud)
我的webservice方法是:
[WebMethod]
public string HelloWorld()
{
return "Hello User";
}
Run Code Online (Sandbox Code Playgroud) 我的应用程序中有一个Magic建议框.为此,我想设置默认选择的值.我也有JSON对象来绑定数据.但我没有找到任何选项,比如如何选择它们.
Magic建议有什么选择吗?
请告诉我.任何帮助,将不胜感激.
I use less-1.7.0.min.js. When I set Arial Black,
@fontFamily: Arial Black,Arial Black,Gadget,sans-serif;
Run Code Online (Sandbox Code Playgroud)
After a CSS is generated, I got this :
p, span {
font-size: 14px;
font-family: Arial #000000, Arial #000000, Gadget, sans-serif;
}
Run Code Online (Sandbox Code Playgroud)
How to escape converting the color name ("Black") into color code (#000000)?
我的情况是我的基本列表包含 ConnectedUser对象.
List<ConnectedUser> userList = new List<ConnectedUser>();
Run Code Online (Sandbox Code Playgroud)
这是ConnectedUser类:
public class ConnectedUser
{
public string phone { get; set; }
public HashSet<string> ConnectionIds { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
那么如何从列表中删除特定的connectionId?
public void static final finalMethod()
{
//This throws error saying "Syntax error on token
//"void", volatile expected"
}
public static final void finalMethod()
{
}
Run Code Online (Sandbox Code Playgroud)
工作良好.为什么订单在定义方法中起着重要作用?为什么java期望volatile关键字在这里?
我是Xcode和Mac环境的新手.我正在使用一些动态和静态库,如boost,Clucene等.我有所有的库
MyApp.app/Contents/Resources
我想将此路径设置为应用程序的dyld_library_path.我试过像编辑XXX.plist文件一样
DYLD_LIBRARY_PATH/mypath/xxx
并在Xcode中设置环境变量和参数无效.
但如果我运行如下所示的shell脚本而不双击我的.dmg中的应用程序就行了
#!/bin/bash
clear
cd /Volumes/xxx/myapp.app/Contents/MacOS
export DYLD_LIBRARY_PATH="/Volumes/xxx/myapp.app/Contents/Resources"
./myapp
Run Code Online (Sandbox Code Playgroud)
我确信这不是正确的方法.每次执行我的应用程序时是否有正确的方法来设置dyld_library_path?
编辑:它也有效,如果你mannualy复制所有你的库到客户端/ usr/lib路径...我想这也不是一个正确的方法来做到这一点.
我正在使用sitecore.对于一个项目,我创建了一个带有简单类型整数字段的模板.此整数字段的默认值为0.
当我基于此模板创建一个值0(默认值)的新项目时,它不会显示.通过将默认值更改为1(例如),将显示该值.有谁知道如何解决这个问题?
非常感谢.
约迪
为什么这段代码会抛出错误?
using (ProviderContext db = new ProviderContext())
{
string sqlcommand = @"GO CREATE TRIGGER [Trigger] ON [dbo].[News] FOR insert AS BEGIN SET NOCOUNT OFF insert [Statistics](NewsStatID) select NewsID from inserted update [Statistics] set Hits = '0' update [Statistics] set Positive = '0' update [Statistics] set Negative = '0' END";
db.Database.ExecuteSqlCommand(sqlcommand);
db.SaveChanges();
}
Run Code Online (Sandbox Code Playgroud)
EntityFramework.SqlServer.dll中出现"System.Data.SqlClient.SqlException"类型的异常,但未在用户代码中处理
其他信息:关键字"TRIGGER"附近的语法错误.
先感谢您!
我一直在发送来自C#的电子邮件,他们工作正常,但现在我也在寻找允许接收者取消订阅的功能.因为我不知道,我无法得到如何继续.我用google搜索了所以需要一些提示.
以下是我的代码:
MailMessage loginInfo = new MailMessage();
loginInfo.To.Add(EmailTxt.Text.ToString());
loginInfo.From = new MailAddress(sEmailId);
loginInfo.Subject = "Subject";
loginInfo.Body = "Your username is: " +;
loginInfo.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = sHost;
smtp.Port = 25;
smtp.EnableSsl = false;
smtp.Credentials = new System.Net.NetworkCredential("", "");
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Send(loginInfo);
Run Code Online (Sandbox Code Playgroud) c# ×6
asp.net ×4
javascript ×2
ajax ×1
css ×1
dyld ×1
dylib ×1
email ×1
font-family ×1
java ×1
jquery ×1
less ×1
linq ×1
list ×1
macos ×1
magicsuggest ×1
mousewheel ×1
sitecore ×1
sitecore6 ×1
sitecore7 ×1
sql ×1
sql-server ×1
syntax ×1
unsubscribe ×1
web-services ×1
xcode ×1
xcode4 ×1
zooming ×1