.NET开发

本类阅读TOP10

·NHibernate快速指南(翻译)
·vs.net 2005中文版下载地址收藏
·【小技巧】一个判断session是否过期的小技巧
·VB/ASP 调用 SQL Server 的存储过程
·?dos下编译.net程序找不到csc.exe文件
·通过Web Services上传和下载文件
·学习笔记(补)《.NET框架程序设计(修订版)》--目录
·VB.NET实现DirectDraw9 (2) 动画
·VB.NET实现DirectDraw9 (1) 托管的DDraw
·建站框架规范书之——文件命名

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
GrapeCity的Combo事件:奇怪的SelectedIndexChanged

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

cmbHaitatubin,cmbShukkasoko,Combo3
  private void cmbShukkasoko_SelectedIndexChanged(object sender, System.EventArgs e)
  {
   if( -1 == cmbShukkasoko.SelectedIndex )
   {
    clsFormFunction.ComboClear( cmbHaitatubin );
    return;
   }

   string strBushoSokoCode = clsFormFunction.GetComboCD( cmbShukkasoko );

   HaitatubinGet( strBushoSokoCode, ref strMsg );
  }

  private int HaitatubinGet( string strBushoSokoCode, ref string strMsg )
  {
   。。。。。。。。
   intRet = CMPSpKick( strSPName, dtsInParam, ref dtsOutParam, ref dtsHaisouBin );

   if( intRet != 0 )
   {
    strMsg = OutParamGet( dtsOutParam.Tables[0], "@o_ERRMSG" );
    return intRet;
   }

   string strDefault = OutParamGet( dtsOutParam.Tables[0], "@o_CmbDefValue" );
   clsFormFunction.ComboDataSetMake( ref dtsCmb, dtsHaisouBin.Tables[0], "BIN", "HAISO_ROOT_MJ" );   
   clsFormFunction.ComboBind( cmbHaitatubin, dtsCmb );
   clsFormFunction.ComboSelect( cmbHaitatubin, strDefault );

   clsFormFunction.SetComboPixWidth( cmbHaitatubin );
   cmbHaitatubin.SelectionStart = 0;
   cmbHaitatubin.SelectionLength = 0;

   return 0;
  }

//cmbHaitatubin,cmbShukkasoko,Combo3's Leave event
  private void combo_FocusLosted(object sender, System.EventArgs e)
  {
   FormFunction clsFormFunction = new FormFunction();
   clsFormFunction.combo_FocusLosted( sender );

   switch (((Control)sender).Name)
   {
    case "cmbShukkasoko":
     if( cmbShukkasoko.SelectedIndex == -1 )
     {
      clsFormFunction.ComboClear( cmbHaitatubin );
      return;
     }
     break;
   }
  }
现象:1 cmbShukkasoko的text是All items text一部分时,click Combo3, cmbShukkasoko不能自动选择匹配的Item,但
click文本控件(非Combo)时正常(能自动选择匹配的Item)。
2 cmbShukkasoko的SelectedIndexChanged时,
cmbHaitatubin不能自动选择某一项。
*****I 服了GrapeCity.Win.Input ..........

答:在另一个事件combo_TextChanging里,使用了GrapeCity提供的Combo.FindString( ... ),该函数在某些情况不能
检索出对应的Item。结果每次设置SelectedIndex 时,Combo.Text改变,但combo_TextChanging里的Combo.FindString( ... )检索不出,导致e.Cancel = true。

GrapeCity, I fu le u .




相关文章

相关软件