华丽的香蕉曲线 发表于 2008-7-2 19:46:04

求方法+233MAX

zhugeyan 发表于 2008-7-2 19:46:51

似乎没有。。。。。。。。。。。。。
不过要看是什么图了

GANA 发表于 2008-7-2 19:49:25

233MAX什么意思来的?

zhugeyan 发表于 2008-7-2 19:50:03

原帖由 华丽的香蕉曲线 于 2008-7-2 19:46 发表 http://bbs.newwise.com/images/common/back.gif
求方法+233MAX
话说真的要看
来了,其实也不复杂,核心部分就一点点,:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
       public float oldValue;
      public float vScrollMutiplier;
      public Form1()
      {
            InitializeComponent();
      }
      private void button1_Click(object sender, EventArgs e)
      {
            Application.Exit();
      }
       private void button2_Click(object sender, EventArgs e)
      {
         FileStream fs;
         try
         {
               saveFileDialog1.Filter = @"所有格式|*.txt;*.doc;|*.TXT|*.txt|*.DOC|*.doc";
               saveFileDialog1.ShowDialog();
               richTextBox1.SaveFile(saveFileDialog1.FileName.ToString(), RichTextBoxStreamType.PlainText);
               
         }
         catch { }
            try
            {
               
                fs =File.Create(textBox1.Text);
            }
            catch{
               
                return;
            }
            Byte[] content = new UTF8Encoding(true).GetBytes(richTextBox1.Text);
            try {
                fs.Write(content,0,content.Length);
                fs.Flush();
                MessageBox.Show("保存成功", "成功", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
               
            }catch{
                MessageBox.Show("写入文件出错", "错误", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
            }finally{
            
            fs.Close();
            }
            
      }
      ///private void SetVerticalScrollMultipliter(Control ctrl) {
          ///float hsb = (float)(vScrollBar1.Height-ctrl.Height);
         ///   float ticks = (float)(vScrollBar1.Maximum - vScrollBar1.Minimum);
      ///       vScrollMutiplier = hsb / ticks;

    ///    }
      private void button3_Click(object sender, EventArgs e)
      {
            
         
            try
            {
                if (!File.Exists(textBox3.Text))
                {
                  
                  MessageBox.Show("文件不存在..");
                }
                FileStream fsa = File.OpenRead(textBox3.Text);
                byte[] arr = new byte;
                UTF8Encoding data = new UTF8Encoding(true);
                while (fsa.Read(arr, 0, arr.Length) > 0)
                {
                  richTextBox1.Text = (data.GetString(arr));
                }
            }
            catch (Exception ex) {
                MessageBox.Show("出现错误"+ex.Message);
            }
      }
      private void 复制ToolStripMenuItem_Click(object sender, EventArgs e)
      {
   
      }
      private void 保存ToolStripMenuItem_Click(object sender, EventArgs e)
      {
            try
            {
            }
            catch { }
      }
      private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
      {
            Application.Exit();
      }
      private void 版本ToolStripMenuItem_Click(object sender, EventArgs e)
      {
            Form2 fud = new Form2();
            fud.Show();
      }
      private void 保存ToolStripMenuItem1_Click(object sender, EventArgs e)
      {
            FileStream fs;
            try
            {
                saveFileDialog1.Filter = @"所有格式|*.txt;*.doc;|*.TXT|*.txt|*.DOC|*.doc";
                saveFileDialog1.ShowDialog();
                richTextBox1.SaveFile(saveFileDialog1.FileName.ToString(), RichTextBoxStreamType.PlainText);
            }
            catch { }
            try
            {
                fs = File.Create(textBox1.Text);
            }
            catch
            {

                return;
            }
            Byte[] content = new UTF8Encoding(true).GetBytes(richTextBox1.Text);
            try
            {
                fs.Write(content, 0, content.Length);
                fs.Flush();
                MessageBox.Show("保存成功", "成功", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
            }
            catch
            {
                MessageBox.Show("写入文件出错", "错误", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
            }
            finally
            {
                fs.Close();
            }
      }
      private void 字体ToolStripMenuItem_Click(object sender, EventArgs e)
      {
            fontDialog1.ShowDialog();
         
      }
      ///private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
   ///{
   ///   floatvAbsPos = (float)(vScrollBar1.Value - vScrollBar1.Minimum);
    ///      SetVerticalScrollMultipliter(pictureBox1);
    ///      if (vScrollBar1.Value > oldValue)
    ///      {
    ///         textBox2.Top = textBox2.Top - (int)(vScrollMutiplier * vAbsPos);
    ///      }
    ///      else if (vScrollBar1.Value < oldValue)
    ///      {
   // /            textBox2.Top = textBox2.Top + (int)(vScrollMutiplier * vAbsPos);
    ///      }
   ///       oldValue = vScrollBar1.Value;
   ///   }
}
   }三杠线的是部分,待补全

zhugeyan 发表于 2008-7-2 19:57:05

这些东西我想了2小时。。。
有点晕了

exilewing 发表于 2008-7-2 20:50:34

华而不实...............

呆鸟 发表于 2008-7-2 20:51:51

说实话,你做的更难看。

moonsp 发表于 2008-7-2 20:53:33

做的更難看+1

真想做的好
用VB不就輕鬆方便多了嗎?

(^-^) 发表于 2008-7-2 21:03:26

VB,N年前乱写个记事本,加了很多乱七八糟的功能,还附带小游戏
但是。。。。。生成的文件,前后都带有“”
读取的文件,MS也都需要。。。。

斩舰猫の空圆斩 发表于 2008-7-2 21:16:52

VB同样照着样例改写过记事本的爬过
最后运行让机器缓冲溢出了

那是敲了一周代码,外加斯巴达修改的结果

从此发誓:就算世界末日,我也不学编程了

斩舰猫の空圆斩 发表于 2008-7-2 21:17:47

顺便半拉这次编写费心了,看到代码,又头疼了

(^-^) 发表于 2008-7-2 21:26:01

LOL喵,这可是你本行啊,小心毕业论文喵~
顺便~捏~~~~~

moonsp 发表于 2008-7-2 22:01:51

VB那個“”不是可以簡單調整的嗎?
詳細的忘了,但至少我自己以前弄的絕無此問題

不過老實說,VB也就只有這些地方可以玩玩看
真正的還是乖乖的用C#吧

zhugeyan 发表于 2008-7-3 09:38:46

原帖由 Amynot 于 2008-7-2 21:34 发表 http://bbs.newwise.com/images/common/back.gif
自带的的确是渣 不过你做的也不怎么样 这种软件实用性最高
YO..上面的小图标好多。。。功能满塞。
但是加点功能很难么?
。。。。。。。。。。
。。。。。。。。。。
。。。。。。。。。。
。。。。。。。。。
。。。。。。。。。
难个P,说了是2小时鼓捣出来的东西,能只把基本功能实现了
至于难看好看的问题,也要看人。
各位前辈看不过去是你们的事,我出来买酱油的
飘~

axlsdsg 发表于 2008-7-3 09:41:08

C语言吗?
main()
{
}
中间不会.....

zhugeyan 发表于 2008-7-3 09:41:17

原帖由 斩舰猫の空圆斩 于 2008-7-2 21:17 发表 http://bbs.newwise.com/images/common/back.gif
顺便半拉这次编写费心了,看到代码,又头疼了
对了,十六夜同学幸运星的漫画买到了吗~~

Culdcept 发表于 2008-7-3 13:48:51

写着玩玩没问题,只是代码中某些编写习惯实在不太好……

zhugeyan 发表于 2008-7-4 16:23:08

续更新。。。。。。。。。
LOLI猫快进来

zhugeyan 发表于 2008-7-4 16:35:39

美化问题下版再说。。。。
PHOTOSHOP。。我来了

kakayv 发表于 2008-7-4 20:19:34

这个是。。。勇敢的向操作系统进化中的记事本君?
页: 1 2 [3]
查看完整版本: ME的征途是推翻记事本和IE