问题如标题,请高手赐教

解决方案 »

  1.   

    不解 楼主 用意?
    winform 的话 设计 状态 就可以确定web 的话 用表格 确定.
      

  2.   

    楼主可能是用多行的textbox吧
    没有尝试过,可以给textbox的样式表试试!
      

  3.   

    重写textbox控件,有一定难度,建议用第三方控件。
      

  4.   

    如果在web 参考 line-height 的用法 
    如果是WinForm中还有没有想到 可能需要用RichTextBox并且使用RTF
      

  5.   

    在winform里用textbox,想让内容跟一些其他阅读软件一样,可以调整每行的显示间距
      

  6.   

    from 
    http://www.labblog.com/user1/hljria/200752144138.htmlusing System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;
    namespace WindowsApplication2
    {
        public partial class Form1 : Form
        {
            public const int WM_USER = 0x0400;
            public const int EM_GETPARAFORMAT = WM_USER + 61;
            public const int EM_SETPARAFORMAT = WM_USER + 71;
            public const long MAX_TAB_STOPS = 32;
            public const uint PFM_LINESPACING = 0x00000100;
            [StructLayout( LayoutKind.Sequential )]
            private struct PARAFORMAT2{    
                public int cbSize;    
                public uint dwMask;    
                public short wNumbering;    
                public short wReserved;    
                public int dxStartIndent;    
                public int dxRightIndent;    
                public int dxOffset;    
                public short wAlignment;    
                public short cTabCount;    
                [MarshalAs( UnmanagedType.ByValArray, SizeConst = 32 )]    
                public int[] rgxTabs;    
                public int dySpaceBefore;    
                public int dySpaceAfter;    
                public int dyLineSpacing;    
                public short sStyle;    
                public byte bLineSpacingRule;   
                public byte bOutlineLevel;    
                public short wShadingWeight;    
                public short wShadingStyle;    
                public short wNumberingStart;    
                public short wNumberingStyle;    
                public short wNumberingTab;    
                public short wBorderSpace;    
                public short wBorderWidth;    
                public short wBorders;}
            public Form1()
            {
                InitializeComponent();
            }        
            [DllImport( "user32", CharSet = CharSet.Auto )]
            private static extern IntPtr SendMessage( HandleRef hWnd, int msg,int wParam, ref PARAFORMAT2 lParam );        
            private void Form1_Load(object sender, EventArgs e)
            {
            }        private void button1_Click(object sender, EventArgs e)
            {
                PARAFORMAT2 fmt = new PARAFORMAT2(); 
                fmt.cbSize = Marshal.SizeOf(fmt);
                fmt.bLineSpacingRule = 4;
                fmt.dyLineSpacing = 500;//((int)richTextBox1.Font.Size) * 20 * ((int)ud.Value);
                fmt.dwMask = PFM_LINESPACING;
                SendMessage( new HandleRef(this.richTextBox1, richTextBox1.Handle ), EM_SETPARAFORMAT, 0, ref fmt );
            }
        }
    }
      

  7.   

    谢谢zswang给的答案,但是没有完全解决问题
    1.只能改变richtextbox的行间距,上述方法对textbox无效2.而且改变行间距的时候,只改变了鼠标焦点所在的几行,没有把所有内容的行间距改变,如何解决zswang,我会在结稿的时候答谢你的,呵呵
      

  8.   

    对于textbox该方法无效对于richtextbox,要先执行selectall(),才能改变所有内容行间距,谢谢zswang
      

  9.   

    附带产生了些问题
           private struct PARAFORMAT2{    
                public int cbSize;    
                public uint dwMask;    
                public short wNumbering;    
                public short wReserved;    
                public int dxStartIndent;    
                public int dxRightIndent;    
                public int dxOffset;    
                public short wAlignment;    
                public short cTabCount;    
                [MarshalAs( UnmanagedType.ByValArray, SizeConst = 32 )]    
                public int[] rgxTabs;    
                public int dySpaceBefore;    
                public int dySpaceAfter;    
                public int dyLineSpacing;    
                public short sStyle;    
                public byte bLineSpacingRule;   
                public byte bOutlineLevel;    
                public short wShadingWeight;    
                public short wShadingStyle;    
                public short wNumberingStart;    
                public short wNumberingStyle;    
                public short wNumberingTab;    
                public short wBorderSpace;    
                public short wBorderWidth;    
                public short wBorders;}具体每个字段的含义是什么?
      

  10.   

    然后还有个问题,richtextbox,要先执行玩selectall()后,焦点会跑到别的地方去,怎么让richtextbox执行完selectall()后焦点不变化?