|
[挑战自我] 欢迎任何C#疑难杂症(编写完整软件除外)
[复制链接]
|
|

楼主 |
发表于 19-4-2012 09:20 AM
|
显示全部楼层
大大有个问题想请教你,
Add New Client
我按这个link 他会pop一个javascript的东西出来..可是这个是在fro ...
tmxiaochao 发表于 17-4-2012 11:34 AM 
给我看你的javascript, 我才能知道发生什么事情。 |
|
|
|
|
|
|
|

楼主 |
发表于 19-4-2012 09:48 AM
|
显示全部楼层
我bind到了我要bind的property了。。谢谢。。
twigky 发表于 8-4-2012 07:44 PM 
expandoObject in C# 4.0
- public Form1()
- {
- InitializeComponent();
- dynamic x = new ExpandoObject();
- x.Person = "abc";
- x.Address = "Jalan Besar";
- MessageBox.Show(x.Address);
- textBox1.DataBindings.Add("Text", x, "Address");
- }
复制代码
textBox1.DataBindings.Add("Text", x, "Address"); <---这个不能成功,因为dynamic 不能当data binding. |
|
|
|
|
|
|
|
发表于 19-4-2012 10:23 AM
|
显示全部楼层
expandoObject in C# 4.0
textBox1.DataBindings.Add("Text", x, "Address");
chrizyuen2 发表于 19-4-2012 09:48 AM 
我做了多一个步骤。不过可以做到了binding。
- public struct PropValue
- {
- public Object Value { get; set; }
- }
- class Class1
- {
- private Dictionary<string,PropValue> _props = new Dictionary<string,PropValue>();
- public PropValue this[string Name]
- {
- get
- {
- return _props[Name];
- }
- set
- {
- ....
- }
- }
- }
- //Binding part
- txtAddress.DataBindings.Add("Text", _contact["Address"], "Value");
复制代码
我看了你的expandoObject code之后。。。
真的觉得。。受益不浅!
谢谢! |
|
|
|
|
|
|
|

楼主 |
发表于 19-4-2012 10:29 AM
|
显示全部楼层
回复 163# twigky
谢谢你,我也学到你的method了。 |
|
|
|
|
|
|
|
发表于 19-4-2012 10:34 AM
|
显示全部楼层
回复 twigky
谢谢你,我也学到你的method了。
chrizyuen2 发表于 19-4-2012 10:29 AM 
大家交流交流。。。
C#。。我只是beginner。 |
|
|
|
|
|
|
|
发表于 9-5-2012 12:11 PM
|
显示全部楼层
chrizyuen2 我需要你的幫助 我的project出了問題,add我skype 我必須要今日完成一個任務
skype :kimson101 |
|
|
|
|
|
|
|

楼主 |
发表于 9-5-2012 01:22 PM
|
显示全部楼层
回复 166# kimson101
麻烦你post在这里。 |
|
|
|
|
|
|
|
发表于 10-5-2012 10:50 AM
|
显示全部楼层
|
|
|
|
|
|
|

楼主 |
发表于 10-5-2012 05:19 PM
|
显示全部楼层
本帖最后由 chrizyuen2 于 10-5-2012 05:20 PM 编辑
什么是foreach?
weitao 发表于 10-5-2012 10:50 AM 
要明白foreach. 需要学一样东西,IEnumerable, yield return.
每次你回传(yield return)一个数据,你的while会等待下一个次foreach 的进入。
- using System;
- using System.Collections.Generic;
- public class Program
- {
- static void Main()
- {
- //
- // Compute two with the exponent of 30.
- //
- foreach (int value in ComputePower(2, 30))
- {
- Console.Write(value);
- Console.Write(" ");
- }
- Console.WriteLine();
- }
- public static IEnumerable<int> ComputePower(int number, int exponent)
- {
- int exponentNum = 0;
- int numberResult = 1;
- //
- // Continue loop until the exponent count is reached.
- //
- while (exponentNum < exponent)
- {
- //
- // Multiply the result.
- //
- numberResult *= number;
- exponentNum++;
- //
- // Return the result with yield.
- //
- yield return numberResult;
- }
- }
- }
- //Output:
- //2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 1073741824
复制代码 |
|
|
|
|
|
|
|
发表于 21-5-2012 09:46 AM
|
显示全部楼层
大大,..我想做一个类似去cc店然后按他的game menu pop出来的window form里面排起来的game icon..请问在.net应该用什么control?? |
|
|
|
|
|
|
|

楼主 |
发表于 21-5-2012 01:12 PM
|
显示全部楼层
大大,..我想做一个类似去cc店然后按他的game menu pop出来的window form里面排起来的game icon..请问在.net应该用什么control??tmxiaochao 发表于 21-5-2012 09:46 AM 
listview control  |
|
|
|
|
|
|
|
发表于 21-5-2012 06:10 PM
|
显示全部楼层
可是listview 的是和我们平时开folder然后里面的view是medium icons那种一样吗?我不是要类似details view的 |
|
|
|
|
|
|
|

楼主 |
发表于 21-5-2012 09:37 PM
|
显示全部楼层
可是listview 的是和我们平时开folder然后里面的view是medium icons那种一样吗?我不是要类似details view的 ...
tmxiaochao 发表于 21-5-2012 06:10 PM 
你有example么,要做成怎样!? |
|
|
|
|
|
|
|
发表于 21-5-2012 10:47 PM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 22-5-2012 04:38 PM
|
显示全部楼层
本帖最后由 tmxiaochao 于 22-5-2012 04:39 PM 编辑
大大我要做一个类似将的东西..
http://forums.pcworld.com/index.php?/topic/67386-ubuntu-910-the-good-the-bad-and-the-unknown/那个folder icon..我的东西都是从db里面拉出来的.. |
|
|
|
|
|
|
|

楼主 |
发表于 22-5-2012 05:02 PM
|
显示全部楼层
没错拉,是用C#的listview.快去try try, 有什么不懂再来问。 |
|
|
|
|
|
|
|
发表于 22-5-2012 10:21 PM
|
显示全部楼层
回复 176# chrizyuen2
可是我那个做到的不是detail list的吗? |
|
|
|
|
|
|
|

楼主 |
发表于 23-5-2012 11:23 AM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 25-5-2012 12:42 PM
|
显示全部楼层
谢谢大大, 弄到了. 另外有个问题想问大大.
请问一个method一定要加virtual才可以被ovveride吗? 没有virtual就不能被ovveride了?
sealed 和 abstract怎么用? |
|
|
|
|
|
|
|

楼主 |
发表于 25-5-2012 01:00 PM
|
显示全部楼层
谢谢大大, 弄到了. 另外有个问题想问大大.
请问一个method一定要加virtual才可以被ovveride吗? 没有virtual就不能被ovveride了?
sealed 和 abstract怎么用?tmxiaochao 发表于 25-5-2012 12:42 PM 
method一定要加virtual才可以被override吗 yes
seal 起来,后代就不能override 了。
abstract 有点像 C++ 的prototype. 你只是申明有着function, 但是内容必须由孩子们编写。
http://msdn.microsoft.com/en-us/library/sf985hc5(v=vs.71).aspx |
|
|
|
|
|
|
| |
本周最热论坛帖子
|