|
Hi
i want to draw the line between the two cells of MsflexGrid.As msflexgrid do not have the line event.Please answer this question to how to link the cells of msflexgrid
|
|
|
|
|
I don't know much about the MSFlexGrid control itself, but you can draw lines on any control using ControlName.CreateGraphics.DrawLine(pens.color, x1, y1, x2, y2).
Hope that helps.
-Ray
|
|
|
|
|
Hi
I want to display the message in the following event procidure when a message is received by creating a control dynamically e.g. textbox to display the message. But the control is not created. Where is the bug in my code.
Private Sub MessageReceivedEventHandler(ByVal data As String) Handles remote.MessageReceived
Dim txt As New TextBox
txt.Size = New Size(55, 25)
txt.Location = New Point(x, y)
txt.Name = "strServer"
txt.Text = data
Controls.Add(txt)
End Sub
Thanks
reman
|
|
|
|
|
Amer Rehman wrote: Dim txt As New TextBox
txt.Size = New Size(55, 25)
txt.Location = New Point(x, y)
txt.Name = "strServer"
txt.Text = data
Controls.Add(txt)
Where does x and y in 'txt.Location = New Point(x, y)' comes from?
Regards: Didi
|
|
|
|
|
|
It doesn't look like your changing the X and/or Y position, causing each textbox to be positioned directly under the last textbox that was added.
|
|
|
|
|
I wrote the code these to Update Database Access after do editing in form Vb6. Code is like this
Private Sub CmdUpDate_Click()
Set ws = DBEngine.Workspaces(0)
Set dd = wS.OpenDatabase("C:\Project\Project.mdb")
Dim rs As Recordset
Dim Sql As String
SqL = "select * from report_tab where idd='" & T1.Text & "'"
Set rs = dB.OpenRecordset(SqL, dbOpenSnapshot)
With RsLap
.Clone
!no = T2.Text
!ext = T3.Text
.Update
MsgBox "Updated", vbOKOnly
End With
but, after I click Button Update windows is appear VB error Run-Time
the massage is
'cannot update Data base is read only'
what i must to do?
|
|
|
|
|
labq581 wrote: Private Sub CmdUpDate_Click()
Set ws = DBEngine.Workspaces(0)
Set dd = wS.OpenDatabase("C:\Project\Project.mdb")
Dim rs As Recordset
Dim Sql As String
SqL = "select * from report_tab where idd='" & T1.Text & "'"
Set rs = dB.OpenRecordset(SqL, dbOpenSnapshot)
With RsLap
.Clone
!no = T2.Text
!ext = T3.Text
.Update
MsgBox "Updated", vbOKOnly
End With
What is RsLap, and why do you use .Clone? Normaly you use Clone something like that:
Dim rs as Recordset
...
'open recordset rs
...
Dim rsClone as Recordset
Set rsClone = rs.Clone
Regards: Didi
|
|
|
|
|
also ensure that T2.text and T3.text is above your SQL statement
|
|
|
|
|
Something like this might work.
SqL = "select * from report_tab where idd='" & T1.Text & "'"
Set rs = dB.OpenRecordset(SqL)
With rs
.MoveFirst
.Edit
!no = T2.Text
!ext = T3.Text
.Update
MsgBox "Updated", vbOKOnly
End With
My Access is a bit rusty but IIRC, dbOpeSnapShot gives a read only recordset.
You also need to make a record current by doing a .MoveFirst/.MoveNext and you need to call .Edit.
As I said, I'm a bit rusty but think this is what you need.
If something like this does not work, maybe it's file/folder permissions?
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
I have an idea to make an edit form with datagrid, but i want to create data combo into datagrid by access data base, please give me solutions.
|
|
|
|
|
Check the documentation on how to use a combobox-cell in your datagrid
Regards: Didi
|
|
|
|
|
|
Hello,
I'd like to know if there is an easy way to check whether the cd in my drive is a DVD, CD or Blu-ray disc. This is needed because I need to calculate the disc usage (%). But when I use Drive.TotalSize it returns the amount of used bytes and not the total capacity. I found some code to do this, but the code was enormous, and I need a compact solution.
Cheers,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
Win32_CDROMDrive class might be of your interest. It has properties regarding the media size.
जय हिंद
|
|
|
|
|
Hey! Thanks fot your response. I have tried figuring out if a medium is a DVD or CD using Win32_CDROMdrive with the following code:
Dim driveMedia As New ManagementClass("Win32_CDROMDrive")
For Each mo As ManagementObject In driveMedia.GetInstances()
MsgBox((mo.GetPropertyValue("MediaType")))
Next
However, this returns the type of drive e.g DVD Rewriter etc. Now I figured out that I can determine the media type with Win32_PhysicalMedia (Link)[^], but when I use .GetPropertyValue("MediaType") there it returns Nothing (or an empty string, I'm not sure) while it should return the type of media, e.g CD Rom, DVD + etc.
I don't understand why this doesn't work. Please help me out?
Zaegra
Motivation is the key to software development.
|
|
|
|
|
I thought your aim is to find the total size of the media. Not sure how to identify if the media is CD or DVD. I think looking around in the similar kind of classes will help.
जय हिंद
|
|
|
|
|
That's exactly my aim, but to find the total size I need to know the media type. Or do you know another way to accomplish this? Thanks for your reply btw
Motivation is the key to software development.
|
|
|
|
|
What does Win32_CDROMDrive.MaxMediaSize and Win32_CDROMDrive.MaxMediaSize return?
जय हिंद
|
|
|
|
|
That's the thing: It returns Nothing. I'm using the following code:
Dim driveMedia As New ManagementObjectSearcher("Select * From Win32_CDROMdrive")
For Each mo As ManagementObject In driveMedia.Get()
Debug.WriteLine(mo.GetPropertyValue("MaxMediaSize"))
Next
Seems right to me..?
Motivation is the key to software development.
|
|
|
|
|
Code below works fine for me. "Size" will be returned ONLY if there is a DVD in the slot.
ManagementObjectSearcher o = new ManagementObjectSearcher("select * from win32_cdromdrive");
foreach (ManagementObject obj in o.Get()) {
string s = obj.GetText(TextFormat.Mof);
}
Hope this helps.
जय हिंद
|
|
|
|
|
You can do it by using FileSystemObject
Dim _oFSO = CreateObject("Scripting.FileSystemObject")
Dim _oDrive = _oFSO.GetDrive("G:")
MessageBox.Show(_oDrive.TotalSize)
hth
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
No, this returns the used size of the cd and not the total capacity. By total capacity I mean for a CD ~ 700 MB, and for a DVD ~4.7 GB etc. I have to know this because I have to calculate for how many percent a cd is used. (Used space / Total Capacity) * 100. Any other ideas, maybe?
Thanks for your reply, though!
Motivation is the key to software development.
|
|
|
|
|
Just a thought, and post back please if you succeed because I am interested.
Check this solution Get Total Free Space Drive[^]
I have Vista and Nero with InCD Installed and I had tried over a dozen of code to get the capacity of the CD/DVD and I am getting an error.
Is that your case also?
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
Nope, this example did not work aswell, because a CD never has any free space. The maximumsize is simply the size of the data burnt on the cd/dvd.. And yes, this is my case aswell. I can't find ANY solution on how to determine the real capacity of a DVD or CD nor can I find a solution on how to see whether the inserted medium is a DVD or CD. I'm totally stuck..
Cheers,
Zaegra
Motivation is the key to software development.
|
|
|
|