当前位置:首页
开发技术指南» 文章正文
    引言:

 ·求助    »显示摘要«
    摘要: 我用mfc创建了一个单文档工程,视图采用clistview,然后用clistctrl的insertitem加入了一个图标,显示正常.但是当我重载onpaint的时候就什么也看不见了.求各位帮帮看看,我主要是想做类似windows桌面的东西,有背景有图标,背景可换,图标可动.最后我想问:ondraw 和 onpaint 有什么区别? 先谢过各位了!不胜感激! ......
    摘要: toolbar1上的toolbutton1 我已经用导入imagelist1的图片,现在我想在toolbutton1 上有图片也有文字,要在那个属性才能把文字显示出来呢??? ......


一个关于DataGridr的问题

<asp:datagrid   ID="aa"   runat="server"  
          Width="100%"  
          OnEditCommand="cmdtext"  
          AutoGenerateColumns="false">  
          <columns>  
              <asp:templatecolumn>  
                                    <itemtemplate>  
                            <asp:label   Text=<%  
                                                              Select   Case   CInt(Container.DataItem("user_class"))  
                                                                      Case   9  
                                                                              Response.Write("站长")  
                                                                      Case   8  
                                                                              Response.Write("系统管理员")  
                                                                      Case   7  
                                                                              Response.Write("公司会员")  
                                                                      Case   Is   <   7  
                                                                              Response.Write("普通会员")  
                                                              End   Select  
                                                              %>   runat="server"/>  
                        </itemtemplate>  
              </asp:templatecolumn>  
          </columns>  
  </asp:datagrid>  
   
  我想根据数据库中user_class字段的值来显示不同的文字,怎样写????  
   
   
  大侠请帮帮忙!!!

NO.1   作者: gshope

<asp:label   Text=<%#   asd(DataBinder.Eval(Container.DataItem,"user_class"))%>runat="server"/>  
  然后在后台的.cs文件中写个asd()方法,来处理数据的转换现实。  
 

NO.2   作者: acewang

你这是asp风格,以后最好不要用  
  ----------------  
  <asp:label   Text=<%  
                                                              Select   Case   CInt(Container.DataItem("user_class"))  
                                                                      Case   9  
                                                                              Response.Write("站长")  
                                                                      Case   8  
                                                                              Response.Write("系统管理员")  
                                                                      Case   7  
                                                                              Response.Write("公司会员")  
                                                                      Case   Is   <   7  
                                                                              Response.Write("普通会员")  
                                                              End   Select  
    %>   runat="server"/>  
  ------------------------------  
  <asp:label   Text=<%#CheckUser(DataBinder.Eval(Container.DataItem,"user_class"))%>   ...  
  在后台自己写这个CheckUser函数作判断  
  Public   Function   CheckUser(ID   as   Integer)   as   String  
  Select   Case   ID  
          Case   9  
                return   xxxx  
  ....  
  End   Select  
  End   Public

NO.3   作者: kinglht

写个函数,根据给字段的值返回不同的值,然后绑定该函数!  
  public   string   retFunction(string   s)  
  {  
      try  
      {  
            Int32   i=Int32.Parse(s);  
      }  
      catch  
      {...  
      }  
      Select   Case   i  
                                                                      Case   9  
                                                                              return("站长")  
                                                                      Case   8  
                                                                              return("系统管理员")  
                                                                      Case   7  
                                                                              return("公司会员")  
                                                                      Case   Is   <   7  
                                                                              return("普通会员")  
                                                              End   Select  
   
  }  
   
  然后绑定  
  <itemtemplate>  
                            <asp:label   Text=<%  
                                                              retFunction(Container.DataItem("user_class"))  
                                                                       
                                                              %>   runat="server"/>  
                        </itemtemplate>  
 


    摘要: 我有两个窗体,form1,frmadd. 我想在form1中访问frmadd中的文本框txtg应该怎么访问。把frmadd的一些定义改成public 然后 frmadd frm=new frmadd(); frm.showdialog(); frm.dispose(); frm.txtg="dfasdfsafasf"; 他说无法将类型“string”隐......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE