C#µÝ¹éʵÏÖTreeview
ÎÞÒâ·¢ÏÖÔÚÍøÉϺܸÕѧC#µÄÅóÓÑÃǶ¼ÔÚÕÒ¹ØÓÚC#ÈçºÎµÝ¹éʵÏÖTreeViewµÄ°ó¶¨£¬¼ûÍøÉϺܶàÀý×Ó¶¼±È½ÏÉî°Â£¬ÎÒÌØÒâдÁ˸ö±È½Ï¼òµ¥Ò׶®µÄÀý×Ó°ïÖú´ó¼ÒÁ˽âC#TreeViewµÄ²Ù×÷ÓëµÝ¹éµÄʵÏÖ...
±¾ÎÄÖ»ÊÇÓõݹéµÄ·½Ê½¼òµ¥ÊµÏÖTreeViewµÄ²Ù×÷£¬¿ÉÄÜ´æÔÚÐÔÄÜÉϵÄÎÊÌ⣬½ö¹©³õѧÕ߲ο¼¡£
Ч¹ûͼ£º
Ò»£º´´½¨Êý¾Ý¿âºÍÊý¾Ý±í£¨Area£©
¶þ£º´´½¨AreaManageÏîÄ¿£º
ÏîÄ¿½á¹¹£º
ÒÔÏÂÊǸ÷¸öÀàÎļþµÄ´úÂ룺
1.SQLOperate.cs
/// <summary>
///SQLOperate µÄժҪ˵Ã÷
/// </summary>
public class SQLOperate
{
/// <summary>
/// ¸ù¾ÝparentId²éµØÇøÐÅÏ¢
/// </summary>
/// <param name="parentId"></param>
/// <returns></returns>
public static DataTable GetAreaInfoByParentId(int parentId)
{
string sql = "select * from Area where ParentId = @ParentId";
SqlParameter[] para = new SqlParameter[]
{
new SqlParameter("@ParentId",parentId)
};
return DBHelper.GetDataSet(sql, para);
}
/// <summary>
/// ¸ù¾ÝID²éÕÒµØÇø
/// </summary>
/// <param name="areaId"></param>
/// <returns></returns>
public static DataTable GetAreaInfoById(int areaId)
{
string sql = "select * from Area where AreaId = @AreaId";
SqlParameter[] para = new SqlParameter[] { new SqlParameter("@Areaid",areaId)};
return DBHelper.GetDataSet(sql, para);
}
/// <summary>
/// Ôö¼Óͬһ¼¶µØÇø
/// </summary>
/// <param name="parentId"></param>
/// <param name="areaName"></param>
/// <returns></returns>
public static int AddParityClass( int parentId,string areaName)
{
string sql = "insert into Area(AreaName,ParentId)values(@AreaName,@ParentId)";
SqlParameter[] para = new SqlParameter[]
{
new SqlParameter("@AreaName",areaName),
new SqlParameter("@ParentId",parentId)
};
Ïà¹ØÎĵµ£º
Õâ¸öÎÊÌâÒ²²»ÖªµÀÄѵ¹Á˶àÉÙC#ºÀ½Ü¡£±ÈÆðMFCµÄ½çÃæˢУ¬ÔÚWINFORMÖÐÀ´ÊµÏÖ¶àÏß³ÌË¢ÐÂÕæÊǺÜÍ´¿à£¬¹Êд´ËÎÄ¡£
¶àÏß³ÌˢнçÃæÖ÷ÒªÓõ½¶àỊ̈߳¬Î¯ÍУ¬Ḭ̈߳²È«¡¢Ê¼þµÈһϵÁиßÄѶȵÄC#²Ù×÷¡£
¹ØÓÚίÍкÍʼþ£¬ÕâÓÐһƪºÜÒ׶®µÄÎÄÕ£ºhi.baidu.com/anglecloudy/blog/item/a52253ee804d052f2df534ab.html
£½£½£½£½£½£½£½£½ ......
C#»ñÈ¡×Ö·û´®µÄ³¤¶È
×÷Õߣºylclass À´Ô´£º²©¿ÍÔ° ·¢²¼Ê±¼ä£º2009-10-30 16:25 ÔĶÁ£º193 ´Î ÔÎÄÁ´½Ó [ÊÕ²Ø]
1¡¢ ʹÓÃg.MeasureString£¨£©»ñµÃ
ʹÓÃMeasureString²âÁ¿³öÀ´µÄ×Ö·û¿í¶È£¬×ÜÊDZÈʵ¼Ê¿í¶È´óһЩ£¬¶øÇÒËæ×Å×Ö·û ......
¸ù¾Ý¿í¶ÈÀ´¾ö¶¨ÏÔʾµÄ×Ö·û´®³¤¶È (C#,VS2005)
Èç¹û lable³¤¶È¹Ì¶¨µ«×Ö·û´®³¤¶È¿É±ä£¬Èç¹û³¬¹ýÁËlableÏÔʾµÄ³¤¶Èʱ£¬Ï£ÍûÓà ...´úÌæʣϵÄ×Ö·û£¬ÕâʱÐèÒªÒ»¸öº¯Êý
Graphics.MeasureString
¾ßÌå´úÂëÈçÏÂ
public string Abbreviation(string str)
{
&nbs ......
IndexOf()
²éÕÒ×Ö´®ÖÐÖ¸¶¨×Ö·û»ò×Ö´®Ê״γöÏÖµÄλÖÃ,·µÊ×Ë÷ÒýÖµ£¬È磺
str1.IndexOf("×Ö")£» //²éÕÒ“×Ö”ÔÚstr1ÖеÄË÷ÒýÖµ£¨Î»Öã©
str1.IndexOf("×Ö´®")£»//²éÕÒ“×Ö´®”µÄµÚÒ»¸ö×Ö·ûÔÚstr1ÖеÄË÷ÒýÖµ£¨Î»Öã©
str1.IndexOf("×Ö",start,end)£»//´Óstr1µÚstart+1¸ö×Ö·ûÆ𣬲éÕÒend¸ö×Ö·û£¬²éÕ ......