28-09-13, 01:43 PM
بسم الله الرحمن الرحيم
السلام عليكمالسؤال:
كيف يمكن تنسيق الرقم حتى يسهل قراءته
اي الرقم 6500
يجب ان يظهر 6,500
تم ارفاق صورة لبرنامج سبق ان عملته بالاكسس فيه تخيل لسؤالي
والف شكر
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Cost As Integer = 9887655
MsgBox(Cost.ToString("##,###,###.##"))
End Sub
Dim x As Double = Val(Me.txt_Shra.Text)
txt_Shra.BackColor = Color.White
txt_Shra.Text = x.ToString("##,###,###.##")
Sub DataGrid_set()
On Error Resume Next
Dim xDB As New DB.Data_Kafi
Dim beda = From d In xDB.Fixed_Bedas
Select d
Dim bsn As New BindingSource()
bsn.DataSource = beda
DGV.AutoGenerateColumns = False
With Motasalsel_Column
.DataPropertyName = "Beda_id"
.HeaderText = "متسلسل"
.Width = 0
.Visible = False
End With
With Beda_Name_Column
.DataPropertyName = "Beda_Name"
.HeaderText = "اســـم المــــــادة"
.Width = 200
.Visible = True
End With
With Shra_Column
.DataPropertyName = "Shra_Price"
.HeaderText = "سعر الشراء"
.Width = 90
.Visible = True
End With
With Mabie_Column
.DataPropertyName = "Mabee_Price"
.HeaderText = "سعر المبيع"
.Width = 90
.Visible = True
End With
With Rabeh_Column
.DataPropertyName = "Rabeh"
.HeaderText = "ربــح المــادة"
.Width = 90
.Visible = True
End With
With Note_Column
.DataPropertyName = "Beda_Note"
.HeaderText = "ملاحظــــــات"
.Width = 392
.Visible = True
End With
With DGV
.DataSource = bsn
.ReadOnly = True
.MultiSelect = False
.SelectionMode = DataGridViewSelectionMode.FullRowSelect
.ShowRowErrors = False
.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
.ShowCellErrors = False
.AllowUserToAddRows = False 'Disabled or hide (*) Symbol...
.AllowUserToResizeColumns = False 'Disable HearderText Resize Column...
.AllowUserToResizeRows = False 'Disabled row resize...
.RowHeadersVisible = True 'To hide Left indicator...
.DefaultCellStyle.SelectionBackColor = Color.SteelBlue 'Selection backcolor....
.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen 'Alternating Backcolor
.Columns.AddRange(New DataGridViewColumn() {Motasalsel_Column, Beda_Name_Column, Shra_Column, Mabie_Column, Rabeh_Column, Note_Column})
End With
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DGV.Columns(1).DefaultCellStyle.Format = "##,###,###,###.##"
DGV.Columns(1).ValueType = GetType(Integer)
DGV.Columns(2).DefaultCellStyle.Format = "##,###,###,###.##"
DGV.Columns(2).ValueType = GetType(Integer)
End Sub
MsgBox(FormatNumber(12345.89))