91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 66KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-11
  • 語言: 其他
  • 標簽: winfrom??C#??

資源簡介

本案例介紹了設置RichTextBox的文本對齊方式,需要的朋友請看

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.IO;//需引用命名空間Using?System.IO

namespace?PlantTextAlignMode
{
????public?partial?class?PlantTextAlignMode?:?Form
????{
????????public?PlantTextAlignMode()
????????{
????????????InitializeComponent();
????????}

????????string?temp?=?“tomorrow.RTF“;//保存文件的路徑
????????private?void?PlantTextAlignMode_Load(object?senderEventArgs?e)
????????{
????????????if(File.Exists(temp))//當在指定路徑下存在該文件時
????????????{
????????????????this.richTextBox1.LoadFile(tempRichTextBoxStreamType.RichText);//從指定的位置加載RTF文件
????????????????unfold.Enabled?=?false;//設定“打開”按鈕為不可用狀態
????????????}
????????????hold.Enabled?=?false;//設定“保存”按鈕為不可用狀態
????????}

????????private?void?unfold_Click(object?senderEventArgs?e)
????????{
????????????OpenFileDialog?TxTOpenDialog?=?new?OpenFileDialog();//聲明一個用于打開文件對話框的對象
????????????TxTOpenDialog.Filter?=?“RTF文件(*.RTF)|*.RTF“;//定義打開文件對話框的過濾參數
????????????if(TxTOpenDialog.ShowDialog()?==?DialogResult.OK)//當在打開對話框中單擊“打開”按鈕時
????????????{
????????????????temp?=?TxTOpenDialog.FileName;//保存打開文件的路徑
????????????????this.richTextBox1.LoadFile(TxTOpenDialog.FileNameRichTextBoxStreamType.RichText);//從指定的位置加載RTF文件
????????????????hold.Enabled?=?false;//設置“保存”按鈕為不可用狀態
????????????????unfold.Enabled?=?false;?//設置“打開”按鈕為不可用狀態
????????????????MessageBox.Show(“讀取成功!““提示信息“MessageBoxButtons.OKMessageBoxIcon.Asterisk);//彈出讀取成功時的提示信息
????????????}
????????}

????????private?void?hold_Click(object?senderEventArgs?e)
????????{
????????????ConserveMeasure(temp);//在指定路徑下保存文件
????????}

????????private?void?richTextBox1_TextChanged(object?senderEventArgs?e)
????????{
????????????hold.Enabled?=?true;//
????????????if(this.richTextBox1.Text?==?““?||?this.richTextBox1.Text?==?null)//
????????????{
????????????????unfold.Enabled?=?true;//
????????????}
????????}

????????private?void?ConserveMeasure(string?path)
????????{
????????????SaveFileDialog?TxTSaveDialog?=?new?SaveFileDialog();//定義一個用于保存文件的保存對話框
????????????TxTSaveDialog.Filter?=?“RTF文件(*.RTF)|*.RTF“;//設置保存文件的過濾參數
????????????if(File.Exists(path))//當在指定路徑下存在該路徑時
????????????{
????????????????this.richTextBox1.SaveFile(pathRichTextBoxStreamType.RichText);//保存指定文件到指定位置
????????????????MessageBox.Show(“保存成功!““提示信息“MessageBoxButtons.OKMessageBoxIcon.Asterisk);//彈出保存成功的提示信息
????????????????this.richTextBox1.Clear();//清空RichTextBox控件中的所有內容
????????????????hold.Enabled?=?false;//設置“保存”按鈕為不可用狀態
????????????}
????????????else
????????????{
????????????????if(TxTSaveDialog.ShowDialog()?==?DialogResult.OK)//當在保存對話框中單擊“保存”按鈕時
????????????????{
????????????????????this.richTextBox1.SaveFile(TxTSaveDialog.FileNameRichTextBoxStreamType.RichText);//保存文件到指定的位置
????????????????????MessageBox.Show(“保存成功!““提示信息“MessageBoxButtons.OKMessageBoxIcon.Asterisk);

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-04-05?09:00??PlantTextAlignMode\
?????目錄???????????0??2012-04-05?09:00??PlantTextAlignMode\PlantTextAlignMode\
?????文件?????????944??2009-02-17?10:14??PlantTextAlignMode\PlantTextAlignMode.sln
?????文件???????16896??2009-03-04?11:24??PlantTextAlignMode\PlantTextAlignMode.suo
?????目錄???????????0??2012-04-05?09:00??PlantTextAlignMode\PlantTextAlignMode\bin\
?????目錄???????????0??2012-04-10?10:28??PlantTextAlignMode\PlantTextAlignMode\bin\Debug\
?????文件???????24064??2012-04-10?10:27??PlantTextAlignMode\PlantTextAlignMode\bin\Debug\PlantTextAlignMode.exe
?????文件???????34304??2012-04-10?10:27??PlantTextAlignMode\PlantTextAlignMode\bin\Debug\PlantTextAlignMode.pdb
?????文件???????14328??2012-04-10?10:27??PlantTextAlignMode\PlantTextAlignMode\bin\Debug\PlantTextAlignMode.vshost.exe
?????文件?????????490??2009-06-11?05:14??PlantTextAlignMode\PlantTextAlignMode\bin\Debug\PlantTextAlignMode.vshost.exe.manifest
?????文件????????6963??2012-04-10?10:28??PlantTextAlignMode\PlantTextAlignMode\bin\Debug\tomorrow.rtf
?????目錄???????????0??2012-04-05?09:00??PlantTextAlignMode\PlantTextAlignMode\obj\
?????目錄???????????0??2012-04-10?10:27??PlantTextAlignMode\PlantTextAlignMode\obj\Debug\
?????文件????????3298??2012-04-10?10:27??PlantTextAlignMode\PlantTextAlignMode\obj\Debug\PlantTextAlignMode.csproj.FileListAbsolute.txt
?????文件?????????992??2009-02-17?11:05??PlantTextAlignMode\PlantTextAlignMode\obj\Debug\PlantTextAlignMode.csproj.GenerateResource.Cache
?????文件???????24064??2012-04-10?10:27??PlantTextAlignMode\PlantTextAlignMode\obj\Debug\PlantTextAlignMode.exe
?????文件???????34304??2012-04-10?10:27??PlantTextAlignMode\PlantTextAlignMode\obj\Debug\PlantTextAlignMode.pdb
?????文件?????????180??2012-04-10?10:27??PlantTextAlignMode\PlantTextAlignMode\obj\Debug\PlantTextAlignMode.PlantTextAlignMode.resources
?????文件???????12094??2012-04-10?10:27??PlantTextAlignMode\PlantTextAlignMode\obj\Debug\PlantTextAlignMode.Properties.Resources.resources
?????目錄???????????0??2009-03-24?10:29??PlantTextAlignMode\PlantTextAlignMode\obj\Debug\Refactor\
?????目錄???????????0??2012-04-05?09:00??PlantTextAlignMode\PlantTextAlignMode\obj\Debug\TempPE\
?????文件????????5120??2009-02-17?10:16??PlantTextAlignMode\PlantTextAlignMode\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
?????文件????????4546??2009-03-04?11:09??PlantTextAlignMode\PlantTextAlignMode\PlantTextAlignMode.cs
?????文件????????4124??2009-03-03?14:56??PlantTextAlignMode\PlantTextAlignMode\PlantTextAlignMode.csproj
?????文件????????8849??2009-02-17?11:05??PlantTextAlignMode\PlantTextAlignMode\PlantTextAlignMode.Designer.cs
?????文件????????5814??2009-02-17?11:05??PlantTextAlignMode\PlantTextAlignMode\PlantTextAlignMode.resx
?????文件?????????512??2009-02-17?10:14??PlantTextAlignMode\PlantTextAlignMode\Program.cs
?????目錄???????????0??2012-04-05?09:00??PlantTextAlignMode\PlantTextAlignMode\Properties\
?????文件????????1368??2009-02-17?10:14??PlantTextAlignMode\PlantTextAlignMode\Properties\AssemblyInfo.cs
?????文件????????3637??2009-02-17?10:16??PlantTextAlignMode\PlantTextAlignMode\Properties\Resources.Designer.cs
?????文件????????6707??2009-02-17?10:16??PlantTextAlignMode\PlantTextAlignMode\Properties\Resources.resx
............此處省略7個文件信息

評論

共有 條評論