好東西不敢獨享,給大家分享一下

99441dudu 2004-03-20 04:12:49
1. 你們的label/checkBox是不是不能設計成透明?
答案: checkBox1.BackColor = Color.FromArgb(0, checkBox1.BackColor)
...全文
60 15 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
leogon 2004-04-22
  • 打赏
  • 举报
回复
记住先!
99441dudu 2004-04-15
  • 打赏
  • 举报
回复
5.只能輸入數值的DataGridTextBoxColumn
C# 部分
public class DataGridDigitsTextBoxColumn : DataGridTextBoxColumn
{
public DataGridDigitsTextBoxColumn(System.ComponentModel.PropertyDescriptor pd, string format, bool b)
: base(pd, format, b)
{
this.TextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(HandleKeyPress);

}

private void HandleKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
//ignore if not digit or control key
if(!char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar))
e.Handled = true;

//ignore if more than 3 digits
if(this.TextBox.Text.Length >= 3 && !char.IsControl(e.KeyChar) && this.TextBox.SelectionLength == 0)
e.Handled = true;
}

protected override void Dispose(bool disposing)
{
if(disposing)
this.TextBox.KeyPress -= new System.Windows.Forms.KeyPressEventHandler(HandleKeyPress);

base.Dispose(disposing);

}
}
}
99441dudu 2004-03-25
  • 打赏
  • 举报
回复
4.在DataSet使用SQL語句

以 Customers 和 Orders 資料表考量資料集。若要以 Kelly 的 FirstName 篩選 Customers 的資料,您可以使用 Select 方法,這個方法會傳回資料列的陣列。

myRowArray = dsCustomers.Select("ContactName like 'Kelly%'")

請注意,陳述式和 ANSI-SQL 類似。基本上它們是 ANSI-SQL 的子集,具有以下差異:因為資料集能夠容納多個相關資料表,所以篩選條件可以在這些相關資料表上進行篩選。在下列範例中,使用 Child 關鍵字來篩選 Orders 和 Customers 資料表。


myRowArray = dsCustomers.Select("ContactName like 'Kelly%' AND [child].OrderDate = '7/26/68'")
這些函式會傳回資料列的陣列。您可以使用 foreach 陳述式重複整個陣列。

zhouats2000 2004-03-22
  • 打赏
  • 举报
回复
up
smalllove 2004-03-22
  • 打赏
  • 举报
回复
mark!
henryniu 2004-03-22
  • 打赏
  • 举报
回复
textbox怎么不管用?
simonllf 2004-03-21
  • 打赏
  • 举报
回复
mark too
scegg 2004-03-21
  • 打赏
  • 举报
回复
MARK
99441dudu 2004-03-21
  • 打赏
  • 举报
回复
3.EXcel的設定方面,獲取正在Excel.Application。book‘name
:>你肯定要開個Excel 應用程序先,該那個book的name為"Haha"
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
REM Dim xlSheet As Excel.Worksheet
Dim myBookName As String

xlApp = CType((GetObject(, "Excel.Application")), Excel.Application)
xlBook = CType(xlApp.ActiveWorkbook, Excel.Workbook)
myBookName = xlBook.Name
MsgBox(myBookName)
--- 結果:顯示出Haha
hanbin7965 2004-03-20
  • 打赏
  • 举报
回复
还看不太懂,先谢谢楼主
zihu928 2004-03-20
  • 打赏
  • 举报
回复
Thx
xdd1125 2004-03-20
  • 打赏
  • 举报
回复
这是alpha混合,把它放在form上有效果,但在其它控件上时就不行了


谢谢楼主!!
banni2003 2004-03-20
  • 打赏
  • 举报
回复
受教了,谢谢楼主。
xdd1125 2004-03-20
  • 打赏
  • 举报
回复
没有效果呀!!
99441dudu 2004-03-20
  • 打赏
  • 举报
回复
2.只能輸入數值的TextBox的class
[VB.NET]

Public Class NumbersOnlyTextBox

Inherits TextBox

Public Sub New()

AddHandler Me.KeyPress, AddressOf HandleKeyPress

End Sub 'New

Private Sub HandleKeyPress(sender As Object, e As KeyPressEventArgs)

If Not Char.IsDigit(e.KeyChar) And Not Char.IsControl(e.KeyChar) Then

e.Handled = True

End If

End Sub 'HandleKeyPress

End Class 'NumbersOnlyTextBox

16,721

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧