【gocity软件源码】【发圈赚钱源码】【榜单单页源码】c printdocument源码
1.WinForms记事本打开
2.C#ç¼ç¨å
¨è½è¯å
¸çå¾ä¹¦ç®å½
3.vb.net如何实现打印DataGridView1里的源码内容,求源码
WinForms记事本打开
使用打印 dlgPageSetup printDocument_txt
菜单和工具栏menuStrip1
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;
using System.Drawing.Printing;
using Microsoft.Win;
namespace 记事本
{
public partial class Form_Notepad : Form
{
private string filename = "无标题";
private bool isEdited = false;
private Font font;
private Color color;
private string[] lines;
private int linesPrinted;
private bool 是源码gocity软件源码否自动换行;
private AboutBox_Me aboutMe = new AboutBox_Me();
private string FileName
{
get { return filename; }
set
{
this.filename = value;
try
{
this.richTextBox_EditField.Clear();
this.richTextBox_EditField.Text = File.ReadAllText(filename, System.Text.Encoding.GetEncoding("GB"));
}
catch (IOException ioex)
{
MessageBox.Show(ioex.Message, "记事本",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
SetTitle();
}
}
private Font TxtFont
{
set
{
this.font = value;
this.richTextBox_EditField.Font = font;
}
}
public Form_Notepad()
{
InitializeComponent();
this.font = this.richTextBox_EditField.Font;
this.color = this.richTextBox_EditField.ForeColor;
this.richTextBox_EditField.WordWrap = false;
try
{
string msg = "版本 1.0";
//Registry.CurrentConfig.CreateSubKey("Software\\记事本");
Registry.SetValue("HKEY_CURRENT_CONFIG\\Software\\记事本", "记事本 ", msg, RegistryValueKind.String);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
if (是否自动换行)
{
}
}
private void SetTitle()
{
string[] spt = filename.Split(new char[] { '\\' });
this.Text = spt[spt.Length - 1] + " - 记事本";
}
private void 新建ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (isEdited)
保存ToolStripMenuItem_Click(sender, e);
this.filename = "无标题";
SetTitle();
this.richTextBox_EditField.Clear();
}
private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog dlgOpenFile = new OpenFileDialog();
dlgOpenFile.Title = "打开文件";
string dir = Environment.GetFolderPath(Environment.SpecialFolder.Templates);
dlgOpenFile.InitialDirectory = dir;
dlgOpenFile.Filter = "Text documents (*.txt)|*.txt|All Files|*.*";
dlgOpenFile.ShowHelp = true;//显示帮助按钮(在右下角)
dlgOpenFile.HelpRequest += new EventHandler(ofd_HelpRequest);
dlgOpenFile.ValidateNames = true;//自动检查文件是否有效
if (dlgOpenFile.ShowDialog() == DialogResult.OK)
this.FileName = dlgOpenFile.FileName;
}
void ofd_HelpRequest(object sender, EventArgs e)
{
MessageBox.Show("暂时无帮助");
}
void SaveFile()
{
try
{
File.WriteAllText(filename, this.richTextBox_EditField.Text, Encoding.UTF8);
}
catch (IOException ioex)
{
MessageBox.Show(ioex.Message, "记事本",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
private void 保存ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (filename == "无标题" || filename == "")
另存为ToolStripMenuItem_Click(sender,e);
else
try
{
File.WriteAllText(filename, this.richTextBox_EditField.Text);
}
catch (IOException ioex)
{
MessageBox.Show(ioex.Message, "记事本",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
private void 另存为ToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog dlgSaveFile = new SaveFileDialog();
dlgSaveFile.Filter = "Text documents (*.txt)|*.txt|All Files|*.*";
if (dlgSaveFile.ShowDialog() == DialogResult.OK)
{
filename = dlgSaveFile.FileName;
SaveFile();
this.FileName = dlgSaveFile.FileName;
}
}
private void printDocument_txt_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
int x = e.MarginBounds.Left;
int y = e.MarginBounds.Top;
while(linesPrinted < lines.Length)
{
e.Graphics.DrawString(lines[linesPrinted++], font, Brushes.Black, x, y);
y += (int)font.GetHeight() + 5;
if (y >= e.PageBounds.Bottom)
{
e.HasMorePages = true;
return;
}
}
linesPrinted = 0;
e.HasMorePages = false;
}
private void printDocument_txt_BeginPrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
lines = this.richTextBox_EditField.Text.Split(new char[] { '\n' });
int i = 0;
char[] trimParam ={ '\r' };
foreach (string str in lines)
lines[i++] = str.TrimEnd(trimParam);
}
private void printDocument_txt_EndPrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
lines = null;
}
private void 页面设置ToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
dlgPageSetup.ShowDialog();
}
catch (InvalidPrinterException ex)
{
MessageBox.Show(ex.ToString());
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void 字体ToolStripMenuItem_Click(object sender, EventArgs e)
{
FontDialog dlgFont = new FontDialog();
dlgFont.Font = font;
if (dlgFont.ShowDialog() == DialogResult.OK)
this.TxtFont = dlgFont.Font;
}
private void richTextBox_EditField_TextChanged(object sender, EventArgs e)
{
this.isEdited = true;
}
private void 自动换行ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.自动换行ToolStripMenuItem.Checked)
{
this.richTextBox_EditField.WordWrap = true;
this.richTextBox_EditField.ScrollBars = RichTextBoxScrollBars.Vertical;
}
else
{
this.richTextBox_EditField.WordWrap = false;
this.richTextBox_EditField.ScrollBars = RichTextBoxScrollBars.Both;
}
}
private void 撤销ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.richTextBox_EditField.Undo();
}
//操作剪贴板
/* IDataObject d = Clipboard.GetDataObject () ;
if ( d.GetDataPresent ( DataFormats.Bitmap ) )
{
//"当前剪切板中的数据类型是位图!"
}
else if ( d.GetDataPresent ( DataFormats.Text ) )
{
//"当前剪切板中的源码发圈赚钱源码数据类型是文本!"
}
else if ( d.GetDataPresent ( DataFormats.Html ) )
{
//"当前剪切板中的源码榜单单页源码数据类型是超文本!"
}
else
{
//"当前剪切板中的源码android源码管理系统数据类型是其他类型数据!"
}
Bitmap b = ( Bitmap ) d.GetData ( DataFormats.Bitmap ) ;//位图
String c = ( String ) d.GetData ( DataFormats.Text ) ;//文本
*/
private void 剪切ToolStripMenuItem_Click(object sender,源码传奇原生源码 EventArgs e)
{
this.richTextBox_EditField.Cut();
}
private void 复制ToolStripMenuItem_Click(object sender, EventArgs e)
{
Clipboard.SetData(DataFormats.StringFormat, this.richTextBox_EditField.SelectedText);
//this.richTextBox_EditField.Copy();
}
private void 粘贴ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.richTextBox_EditField.Paste();
}
private void 删除ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.richTextBox_EditField.SelectedText = "";
}
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void Form_Notepad_Load(object sender, EventArgs e)
{
}
private void 打印ToolStripMenuItem_Click(object sender, EventArgs e)
{
PrintDocument doc = new PrintDocument();
doc.DocumentName = filename;
doc.PrintPage += new PrintPageEventHandler(PrintPageEvent);
doc.Print();
}
private void PrintPageEvent(object sender, PrintPageEventArgs e)
{
int count = 0;
foreach (string line in richTextBox_EditField.Lines)
{
e.Graphics.DrawString(line, font, new SolidBrush(color), e.MarginBounds.Left, e.MarginBounds.Top + (count * font.GetHeight(e.Graphics)), new StringFormat());
count++;
}
}
}
}
C#ç¼ç¨å ¨è½è¯å ¸çå¾ä¹¦ç®å½
第1ç« ä¸ºä»ä¹è¯´ãC#ç¼ç¨å ¨è½è¯å ¸ãæ¯ç¼ç¨å¼å人åçå¿ å¤å·¥å ·1.1 æµ·éç¼ç¨èµæº
1.1.1 è¶ å®¹éææ¯èµæºåº
1.1.2 å ¨æ¹ä½è§é¢èµæºåº
1.1.3 丰å¯çå®ä¾èµæºåº
1.1.4 å¤è¡ä¸é¡¹ç®èµæºåº
1.1.5 å®é åºç¨æ¹æ¡èµæºåº
1.1.6 ç²¾ç¾ççé¢ç´ æåº
1.1.7 详尽çæºç èµæºåº
1.1.8 å¤åè½çå·¥å ·åº
1.2 ãC#ç¼ç¨å ¨è½è¯å ¸ãéåå类人å使ç¨
1.3 é«ææ¥è¯¢ æºè½æ£ç´¢
1.4 å¤ç§è¯å ¸ åå©ç¼ç¨
1.5 享æå¤ç§æ¹å¼çå级ä¸å®åæå¡
1.5.1 享åå ¨æ¹ä½æå¡
1.5.2 æä¾å¤ç§æ¹å¼çå级
第2ç« ææ ·å¿«é使ç¨ãC#ç¼ç¨å ¨è½è¯å ¸ã
2.1 å¯å¨ãC#ç¼ç¨å ¨è½è¯å ¸ã
2.1.1 å¦ä½å¯å¨ä¸»ç¨åº
2.1.2 å¦ä½å¯å¨æµ®å¨çªå£
2.2 åè¯ç¨åºçé¢
2.2.1 认è¯ä¸»å¯¼èªåº
2.2.2 äºè§£åè½å¯¼èªåº
2.2.3 äºè§£å 容导èªåº
2.2.4 äºè§£å 容æ¾ç¤ºè®¾ç½®åº
2.3 ç¹è²åè½å¿«é使ç¨
2.3.1 å类管ç个人èµæº
2.3.2 ç¼ç¨èµæºæ¥è¯¢
2.3.3 æµ®å¨çªå£æ¥è¯¢
2.3.4 æ¶èéè¦ææ¡£
2.3.5 è®°å½å¦ä¹ å¿å¾
2.3.6 为æ档设置书ç¾
2.3.7 åæ¢å 容æ¾ç¤ºåº
第3ç« å¦ä½å¨âå¼åâ使ç¨æ¨¡å¼ä¸å¦ä¹ å使ç¨ç¼ç¨èµæº
3.1 å¦ä½å类管ç个人ç¼ç¨èµæº
3.2 å¦ä½å¦ä¹ æµè§ç¼ç¨ææ¯èµæº
3.3 å¦ä½å¦ä¹ æµè§åºç¨å®ä¾èµæº
3.4 å¦ä½å¦ä¹ æµè§å¼å项ç®èµæº
3.5 å¦ä½å¦ä¹ æµè§åºç¨æ¹æ¡èµæº
3.6 è§çå ¥é¨åå¼åè§é¢èµæº
3.6.1 ç¨åºå ¥é¨å¦ä¹ å½å
3.6.2 项ç®å¼åè§é¢å½å
3.7 æµè§å使ç¨çé¢ç´ æèµæº
3.7.1 çé¢æµè§
3.7.2 çé¢ä¸å¿å 容导读
3.7.3 éè¿ç®å½å¯¼èªæµè§å¾ç
3.8 æ ¹æ®å®é éè¦ä½¿ç¨âå¼åâ模å¼
3.8.1 æ¥è¯¢ç¼ç¨èµæº
3.8.2 å¦ä¹ ç¼ç¨ææ¯
3.8.3 管çâæç代ç â
第4ç« ä½¿ç¨âå ¥é¨â模å¼è¿è¡é¶æ®µå¼å¦ä¹ +强åè®ç»
4.1 åé¶æ®µå¦ä¹ ç¼ç¨ææ¯
4.1.1 ä»é¶å¼å§
4.1.2 è¿é¶æé«
4.1.3 ä¸çº§å¼å
4.1.4 é«çº§å¼å
4.2 éè¿è®ç»æé«å¼åæè½
4.2.1 å ¥é¨è®ç»
4.2.2 è¿é¶è®ç»
4.2.3 ä¸çº§è®ç»
4.2.4 é«çº§è®ç»
4.3 ä¸åæ°´å¹³çç¼ç¨äººåå¦ä½ä½¿ç¨âå ¥é¨â模å¼
4.3.1 é¶åºç¡ç¼ç¨äººåå¦ä¹ æ¹æ³
4.3.2 ä¸çº§å¼å人å使ç¨æ¹æ³
4.3.3 é«çº§å¼å人å使ç¨æ¹æ³
第5ç« å¦ä½ä½¿ç¨âåºç¨â模å¼å®ç°é«æå¼å
5.1 å©ç¨ç®å½å¿«éå¦ä¹ åæ£ç´¢ç¼ç¨ææ¯
5.2 é«ææ¥è¯¢ä¸æºè½æ£ç´¢ç¼ç¨ææ¯
5.2.1 éè¿å¤ç§æ¹å¼æ¥è¯¢ç¼ç¨ææ¯
5.2.2 éè¿å个åæ¯ï¼å ³é®åï¼æºè½æ£ç´¢ç¼ç¨ææ¯
5.3 ææå©ç¨æºç å®ç°éæ©æ§ä¸è½½
5.4 计ç®æºï¼ä¸ä¸ï¼è±è¯éæ¥
5.4.1 æç´¢ç¼ç¨ä¸ç¨è±è¯è§£é
5.4.2 å¦ä½éèè±è¯è¯å ¸ç®å½ãæ·»å æ ç¾
5.5 使ç¨å¤ç§è¾ å©è¯å ¸åå©ç¼ç¨
5.5.1 SQLè¯å¥è¯å ¸
5.5.2 SQLæ°æ®åºææ¯è¯å ¸
5.5.3 UMLè¯å ¸
5.5.4 软件工ç¨è¯å ¸
5.5.5 ç¨åºæµè¯è¯å ¸
5.5.6 ç¼ç è§èè¯å ¸
5.5.7 æ¯è¯è¯å ¸
5.6 åå©åç§å®ç¨å·¥å ·å¿«éæé«å¼åæç
5.7 ææéè¿å°å·¥å ·è§£å³å®é é®é¢
5.8 ä¸å人群å¦ä½ä½¿ç¨âåºç¨â模å¼è¿è¡å¿«éãé«æçå¼å
5.8.1 é«ææ¥è¯¢ä¸æ£ç´¢æµ·éç¼ç¨èµæº
5.8.2 使ç¨è±è¯è¯å ¸åå ¶ä»è¾ å©è¯å ¸åå©ç¼ç¨
5.8.3 åå©åç§å®ç¨å·¥å ·å®ç°é«æå¼å
第 ç« å½æ°éæ¥
A
Abortæ¹æ³
Absæ¹æ³
AcceptButtonå±æ§
Activateäºä»¶
Addæ¹æ³
AddDaysæ¹æ³
AddStringæ¹æ³
AllowEditå±æ§
AppendTextæ¹æ³
Appllicationç±»
ArrayListç±»
asæä½ç¬¦
ASCIIç
ASCIIEncodingç±»
Attributeså±æ§
AVGèåå½æ°
B
BackColorå±æ§
BackgroudColorå±æ§
BackgroudImageå±æ§
BackgroundWorkerç»ä»¶
baseå ³é®å
BeginConnectæ¹æ³
BeginEditæ¹æ³
BinaryReaderç±»
BinaryWriterç±»
BindingNavigatoræ§ä»¶
Bitmapç±»
Borderå±æ§
BorderStyleå±æ§
breakè¯å¥
BringToFrontæ¹æ³
Buttonæ§ä»¶
åé
C
CalendarFontå±æ§
CalendarForeColorå±æ§
CancelButtonå±æ§
CancelEditå±æ§
CanFocuså±æ§
CanPasteæ¹æ³
Captureå±æ§
caseè¯å¥
CASTå½æ°
Cell对象
CellClickäºä»¶
CellEnteräºä»¶
CellMouseClickäºä»¶
CellLeaveäºä»¶
Cellså±æ§
CheckBoxæ§ä»¶
Checkedå±æ§
CheckedChangedäºä»¶
Childrenå±æ§
Clearæ¹æ³
Clickäºä»¶
Cloneæ¹æ³
Closeæ¹æ³
Colorå±æ§
ColorDialogæ§ä»¶
ColumnCountå±æ§
Columnså±æ§
ComboBoxæ§ä»¶
Command对象
CommandTextå±æ§
CommandTypeå±æ§
Compareæ¹æ³
CompareToæ¹æ³
Computerç±»
ComputerInfoç±»
Connection对象
ConnectionStateæ举
ContextMenuStripæ§ä»¶
continueè¯å¥
Controlç±»
Convertç±»
Consoleç±»
Copyæ¹æ³
CopyFileæ¹æ³
COUNTå½æ°
Countå±æ§
Createæ¹æ³
CreateDirectoryæ¹æ³
CreateSubKeyæ¹æ³
CreateTextæ¹æ³
CryptoStreamç±»
CrystalReportVieweræ§ä»¶
CurrentCellå±æ§
CurrentRowå±æ§
Cursorç±»
Cutæ¹æ³
常é
D
DataAdapterç±»
DataGridViewæ§ä»¶
DataMemberå±æ§
DataReaderç±»
DataSetç±»
DataSourceå±æ§
DATEADDå½æ°
DateDiffæ¹æ³
DateTimeç»æ
DateTimePickeræ§ä»¶
DAYå½æ°
DayOfWeekå±æ§
Deleteæ¹æ³
Directoryç±»
DirectoryEntryç±»
DirectoryInfoç±»
DirectoryNameå±æ§
Disposeæ¹æ³
Dnsç±»
doâ¦whileè¯å¥
Dockå±æ§
Drawæ¹æ³
DrawArcæ¹æ³
DrawEllipseæ¹æ³
DrawImageæ¹æ³
DrawLineæ¹æ³
DrawPathæ¹æ³
DrawPieæ¹æ³
DrawPolygonæ¹æ³
DrawRectangleæ¹æ³
DrawStringæ¹æ³
DriveInfoç±»
DropDownStyleå±æ§
è¿ä»£å¨
E
Enabledå±æ§
Encodingå±æ§
Enteräºä»¶
Environmentç±»
Equalsæ¹æ³
ErrorProvideræ§ä»¶
EventLogç»ä»¶
ExecuteNonQueryæ¹æ³
ExecuteReaderæ¹æ³
Existsæ¹æ³
Existså±æ§
ExpandAllæ¹æ³
Extensionå±æ§
F
Fileç±»
FileInfoç±»
FileNameå±æ§
FileStreamç±»
Fillæ¹æ³
FillEllipseæ¹æ³
FillPathæ¹æ³
FillPieæ¹æ³
FillPolygonæ¹æ³
FillRectangleæ¹æ³
FillRegionæ¹æ³
Filterå±æ§
Findæ¹æ³
Firstå½æ°
FirstDayOfWeekå±æ§
FlatStyleå±æ§
FlowDirectionå±æ§
FlowLayoutPanelæ§ä»¶
Flushæ¹æ³
Focusæ¹æ³
FolderBrowserDialogæ§ä»¶
Fontå±æ§
FontDialogæ§ä»¶
forè¯å¥
foreachè¯å¥
ForeColorå±æ§
Formçªä½
Formatæ¹æ³
FormClosedäºä»¶
FormClosingäºä»¶
FromArgbæ¹æ³
æ³å
åé¨ç±»
G
GDI+
GetBytesæ¹æ³
GetDirectoriesæ¹æ³
GetFilesæ¹æ³
GetFileSystemEntriesæ¹æ³
GetFileSystemInfosæ¹æ³
GetHostAddressesæ¹æ³
GetHostByAddressæ¹æ³
GetHostByNameæ¹æ³
GetHostNameæ¹æ³
GetPixelæ¹æ³
GetStringæ¹æ³
GetValueNamesæ¹æ³
gotoè¯å¥
Graphicsç±»
GroupBoxæ§ä»¶
GetValueæ¹æ³
H
Handleå±æ§
Hashtableç±»
HasRowså±æ§
Heightå±æ§
HelpProviderç»ä»¶
Hideæ¹æ³
HScrollBaræ§ä»¶
I
IsUpperæ¹æ³
ImageFormatç±»
IsLeapYearæ¹æ³
Imageå±æ§
ImageListç»ä»¶
IndexOfæ¹æ³
InitialDirectoryå±æ§
Insertæ¹æ³
Intervalå±æ§
IPEndPointç±»
IPHostEntryç±»
IsMatchæ¹æ³
IsMdiContainerå±æ§
Itemså±æ§
J
Joinï¼Stringç±»ï¼æ¹æ³
Joinï¼Threadç±»ï¼æ¹æ³
K
KeyCharå±æ§
KeyDownäºä»¶
KeyPressäºä»¶
KeyUpäºä»¶
Killæ¹æ³
L
Labelæ§ä»¶
LabelEditå±æ§
Lastå½æ°
LastIndexOfæ¹æ³
LayoutMdiæ¹æ³
Leaveäºä»¶
Lineså±æ§
LinkLabelæ§ä»¶
ListBoxæ§ä»¶
ListViewæ§ä»¶
Loadæ¹æ³
LoadFileæ¹æ³
Locationå±æ§
M
MachineNameå±æ§
Macthesæ¹æ³
MailMessageç±»
ManagementClassç±»
ManagementObjectç±»
MaskedTextBoxæ§ä»¶
MAXå½æ°
MaxDateå±æ§
Maximumå±æ§
MDIçªä½
MdiChildrenå±æ§
MdiParentå±æ§
Microsoft.Winå½å空é´
MINå½æ°
MinDateå±æ§
Minimumå±æ§
MonthCalendaræ§ä»¶
MouseClickäºä»¶
Moveæ¹æ³
MoveToæ¹æ³
MVCå¼å模å¼
N
Navigatedäºä»¶
Navigateæ¹æ³
NetworkStreamç±»
newè¿ç®ç¬¦
newidå½æ°
NewRowæ¹æ³
Nextæ¹æ³
NotifyIconæ§ä»¶
NumericUpDownæ§ä»¶
Net sendå½ä»¤
Net useå½ä»¤
O
objectç±»å
Opacityå±æ§
Openæ¹æ³
OpenFileæ¹æ³
OpenFileDialogæ§ä»¶
OpenSubKeyæ¹æ³
OpenTextæ¹æ³
Ownerå±æ§
P
Paintäºä»¶
Panelæ§ä»¶
PasswordCharå±æ§
Pathå±æ§
PictrueBoxæ§ä»¶
POP3åè®®
Positionå±æ§
Printæ¹æ³
PrintDialogç»ä»¶
PrintDocumentç»ä»¶
PrintPreviewControlç»ä»¶
PrintPreviewDialogç»ä»¶
Processç±»
ProgressBaræ§ä»¶
Pingç±»
PrinterSettingsç±»
Q
Queueç±»
R
RadioButtonæ§ä»¶
Randomç±»
Readæ¹æ³
ReadBytesæ¹æ³
ReadLineæ¹æ³
ReadOnlyå±æ§
ReadToEndæ¹æ³
ReadXmlå½æ°
Receiveæ¹æ³
Refreshå½æ°
Regexç±»
Registryç±»
RegistryKeyç±»
Removeæ¹æ³
RemoveAtæ¹æ³
Replaceæ¹æ³
Returnè¯å¥
RichTextBoxæ§ä»¶
Rightå±æ§
Roundæ¹æ³
RowCountæ¹æ³
Rowså±æ§
S
Saveæ¹æ³
SaveFileæ¹æ³
SaveFileDialogç»ä»¶
ScrollBarså±æ§
Selectæ¹æ³
SelectAllæ¹æ³
Selectedå±æ§
SelectedCellså±æ§
SelectedColumnså±æ§
SelectedIndexå±æ§
SelectedItemå±æ§
SelectedItemså±æ§
SelectedPathå±æ§
SelectedRowså±æ§
SelectedTextå±æ§
SelectionColorå±æ§
SelectionEndå±æ§
SelectionFontå±æ§
Sendæ¹æ³
SetDateæ¹æ³
SetErroræ¹æ³
SetPixelæ¹æ³
SetToolTipæ¹æ³
SetValueæ¹æ³
Showæ¹æ³
ShowDialogæ¹æ³
ShowTodayå±æ§
Sleepæ¹æ³
SMTPåè®®
SmtpClientç±»
Socketç±»
SolidBrushç±»
Sortæ¹æ³
Splitæ¹æ³
SQLæ³¨å ¥å¼æ»å»
SqlCommandç±»
SqlConnectionç±»
SqlDataAdapterç±»
SqlDataReaderç±»
Stackç±»
Startæ¹æ³
StartPositionå±æ§
Stepå±æ§
Stopæ¹æ³
Streamç±»
StreamReaderç±»
StreamWriterç±»
Stringç±»
StringBuilderç±»
Substringæ¹æ³
SUMå½æ°
switch caseè¯å¥
T
TabControlæ§ä»¶
TabIndexå±æ§
Tableså±æ§
TabPageså±æ§
Tagå±æ§
TcpClientç±»
TcpListenerç±»
Textå±æ§
TextBoxæ§ä»¶
TextChangedäºä»¶
TextReaderç±»
TextWriterç±»
Threadç±»
ThreadStateå±æ§
throwè¯å¥
Tickäºä»¶
Timerç»ä»¶
TimeSpan对象
ToIntæ¹æ³
ToLoweræ¹æ³
ToolStripæ§ä»¶
ToolTipæ§ä»¶
ToolTipIconå±æ§
ToolTipTextå±æ§
ToolTipTitleå±æ§
Topå±æ§
TopMostå±æ§
ToShortDateStringæ¹æ³
ToShortTimeStringæ¹æ³
ToStringæ¹æ³
ToUpperæ¹æ³
TrackBaræ§ä»¶
TreeNodeç±»
TreeViewæ§ä»¶
tryâ¦catchâ¦finallyè¯å¥
typeofè¿ç®ç¬¦
U
UdpClientç±»
UpButtonæ¹æ³
Updateæ¹æ³
UPDATEè¯å¥
UpdateCommandå±æ§
Urlå±æ§
usingå ³é®å
V
Valueå±æ§
Viewå±æ§
Visibleå±æ§
VscrollBaræ§ä»¶
W
WebBrowseræ§ä»¶
WebClientç±»
Whileè¯å¥
Widthå±æ§
WindowStateå±æ§
WndProcæ¹æ³
Writeæ¹æ³
WriteLineæ¹æ³
WriteXmlæ¹æ³
X
XML
XmlReaderç±»
XmlWriterç±»
Y
YEARå½æ°
Z
Zoomå±æ§
vb.net如何实现打印DataGridView1里的内容,求源码
使用 PrintDocument 控件的源码 Print() 方法可以打印指定对象中的内容,参考代码如下:Private Sub Button1_Click(ByVal sender As System.Object,源码 ByVal e As System.EventArgs) Handles Button1.ClickPrintDocument1.Print()
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim bm As New Bitmap(Me.DataGridView1.Width, Me.DataGridView1.Height)
DataGridView1.DrawToBitmap(bm, New Rectangle(0, 0, Me.DataGridView1.Width, Me.DataGridView1.Height))
e.Graphics.DrawImage(bm, 0, 0)
End Sub