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

 

    摘要: 我的邮件服务器有个大邮件,收不下来。只能删了。 后来做了个软件删的, 我想怎么使用ftp登陆上去呢,我试了一下,可能是用户名不对。 大家说说。 ......
 ·求助交叉报表的问题    »显示摘要«
    摘要: 一个交叉报表如下 姓名 1类 2类 3类 4类.... 张三 85 5 8 10 里斯 3 4 21 89 王无 15 19 20 77 ..... 要求可按不同的列值去排序,比如我要按1类的排序,那报表就应该是 姓名 1类 2类 3类 4类.... 里斯 3 4 21 89 王无 15 19 20 77 张三 85 5 8 10 要按2类的排序,那报表就应该是 姓名 1类 2类 3类 4......


在Richtextbox控件中如何获得光标的所在的行数和列数

哪位大侠帮忙,一定给分!

NO.1   作者: CForce

//如果有人说win32api没用,我问他这道题不用api又怎么解决?  
  using   System;  
  using   System.Drawing;  
  using   System.Collections;  
  using   System.ComponentModel;  
  using   System.Windows.Forms;  
  using   System.Data;  
  using   System.Runtime.InteropServices;  
   
  namespace   csTest  
  {  
  public   class   Form1   :   System.Windows.Forms.Form  
  {  
   
  [DllImport("user32")]  
  public   static   extern   bool   GetCaretPos(ref   System.Drawing.Point   lpPoint);  
   
  private   System.Windows.Forms.RichTextBox   richTextBox1;  
  private   System.Windows.Forms.Button   buttonGetResult;  
  private   System.ComponentModel.Container   components   =   null;  
   
  public   Form1()  
  {  
  InitializeComponent();  
  }  
  protected   override   void   Dispose(   bool   disposing   )  
  {  
  if(   disposing   )  
  {  
  if   (components   !=   null)    
  {  
  components.Dispose();  
  }  
  }  
  base.Dispose(   disposing   );  
  }  
   
  #region   Windows   Form   Designer   generated   code  
   
  private   void   InitializeComponent()  
  {  
  this.richTextBox1   =   new   System.Windows.Forms.RichTextBox();  
  this.buttonGetResult   =   new   System.Windows.Forms.Button();  
  this.SuspendLayout();  
  //    
  //   richTextBox1  
  //    
  this.richTextBox1.Location   =   new   System.Drawing.Point(16,   24);  
  this.richTextBox1.Name   =   "richTextBox1";  
  this.richTextBox1.Size   =   new   System.Drawing.Size(528,   232);  
  this.richTextBox1.TabIndex   =   0;  
  this.richTextBox1.Text   =   "";  
  //    
  //   buttonGetResult  
  //    
  this.buttonGetResult.Location   =   new   System.Drawing.Point(456,   272);  
  this.buttonGetResult.Name   =   "buttonGetResult";  
  this.buttonGetResult.TabIndex   =   1;  
  this.buttonGetResult.Text   =   "Clike   Me!";  
  this.buttonGetResult.Click   +=   new   System.EventHandler(this.button1_Click);  
  //    
  //   Form1  
  //    
  this.AutoScaleBaseSize   =   new   System.Drawing.Size(5,   13);  
  this.ClientSize   =   new   System.Drawing.Size(560,   301);  
  this.Controls.AddRange(new   System.Windows.Forms.Control[]   {  
      this.buttonGetResult,  
      this.richTextBox1});  
  this.Name   =   "Form1";  
  this.Text   =   "Form1";  
  this.ResumeLayout(false);  
   
  }  
  #endregion  
  [STAThread]  
  static   void   Main()    
  {  
  Application.Run(new   Form1());  
  }  
   
  private   int   X=0;  
  private   int   Y=0;  
  private   void   button1_Click(object   sender,   System.EventArgs   e)  
  {  
  Point   P=new   Point(0);  
  GetCaretPos(ref   P);  
  int   Pos=this.richTextBox1.GetCharIndexFromPosition(P);  
  this.Y=this.richTextBox1.GetLineFromCharIndex(Pos);  
   
  if   (this.Y>0)  
  {  
  int   offset=1;  
  while(this.richTextBox1.Text[Pos-offset]!=\n)    
  offset++;  
  this.X=offset;  
  this.Y++;  
  }  
  else  
  {  
  this.X=Pos+1;  
  this.Y=1;  
  }  
   
  MessageBox.Show("当前位置:   第"+this.Y.ToString()+"行   "+"第"+this.X.ToString()+"列");  
  }  
  }  
  }  
 


    摘要: 件类型为asp auto file的文件怎么打开(阅读)? ......
» 本期热门文章:

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