|
In which case, you simply need to set the DataSource to Nothing; alternatively you could simply use DataGrid.Clear(). By the term 'object' I mean the database or data source which the DataGrid is bound to. Sorry if I caused any confusion. Incidentally, you could have found your answer from
|
|
|
|
|
In order to Clear a DataGrid control having a DataSource property set to some Object, you only need to write DataGrid1.DataSource = Nothing
this will clear the grid automatically.
Tell me whether this solution works or not.
|
|
|
|
|
I write some code as follow:
Module mdlTimerEvent_Drive
Private Declare Function timeSetEvent Lib "winmm.dll" (ByVal interval_Ms As Integer, ByVal resolution_Ms As Integer, _
ByVal lpFunction As [Delegate], ByVal dwUser As Integer, ByVal uFlags As Integer) As Integer
Private Declare Function timeKillEvent Lib "winmm.dll" (ByVal uID As Long) As Long
Private Delegate Sub timeCallback(ByVal uID As Integer, ByVal uMsg As Integer, ByVal dwUser As Integer, _
ByVal dw1 As Integer, ByVal dw2 As Integer)
Private Const elapse_Periodically As Integer = 1
Public m_nInterruptTime As Long
Private Sub TimeProc(ByVal uID As Integer, ByVal uMsg As Integer, ByVal dwUser As Integer, _
ByVal dw1 As Integer, ByVal dw2 As Integer)
m_lngNewCount = m_lngNewCount + 1
End Sub
Public Sub StartTimer()
Dim tmrProc As timeCallback = AddressOf TimeProc
m_lngNewCount = 0
m_lngTimerID = timeSetEvent(m_nInterruptTime, 1, tmrProc, vbNullString, elapse_Periodically)
End Sub
Public Sub StopTimer()
If m_lngTimerID > 0 Then
lngResult = timeKillEvent(m_lngTimerID)
End If
End Sub
End Module
I call mdlTimerEvent_Drive.StartTimer() and it run, but Vs.net show MDA exception "callbackOnCollectedDelegate" after seconds.
What shall I do?
Flying kingdom
|
|
|
|
|
Why do you need to use this instead of the built in timers ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello to everyone,
I am facing the following problem with Vb.Net2005 project for different resolution monitor.
Initially I was doing my VB.net project using a 17 inch monitor. Now when I shifted my project to a flat LCD monitor with different resolution, my ALL CONTROLS POSITION ARE NOT LIKE BEFORE......In future I may have to shift my project to different monitor again. Moreover for deploying the project also, I don't know the resolution of clients monitor in advance....
Could anyone please give me solution for this.
Thanks in advance
I am a learner Always
|
|
|
|
|
Best bet is to buy a good VB.NET book. Read it. Look up 'dock' and 'anchor' in the index for how to lay out your controls so they resize for the form.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
HI Christian,
Thanks for your reply...
I have at least 500 controls all over the project. Is there any way to do the same together or something like that..
Thanks
I am a learner Always
|
|
|
|
|
No, of course not. What magical way would there be to do that, unless you just want them all to sit on the top left of the form. Buy that book, and next time, set these things as you work on the project.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Set the Anchor property for each control according to your design
Your controls will be placed according to the resolution
|
|
|
|
|
thanks praveen.....
So can I just select all controls on the form and set the anchor?
I am a learner Always
|
|
|
|
|
No, you can't. The controls are already anchored, by default, to the top left corner of the form. Changing the anchor for all of the controls all at once will only cause you extreme grief. Really, anchoring and layouts should have been done eariler in the apps development. It sounds like you're missing proper anchoring and proper use of flow and table layout panel controls.
The bottom line is that there is no easy way around your problem. Fixing this is going to take a lot of work that you simply cannot automate or do in a day or two.
|
|
|
|
|
thanks Dave,
I think I will have to stick to not anchoring anything....no other go
I am a beginner
|
|
|
|
|
hi there,
i have one groupbox in that groupbox i have 4 buttons and 2textbox,2 lebels etc....
if i click on buttton 4 than this same groupbox should be come next to this one,,, plz help me
if u dont mind can u send me email
my email id is mitesh_patel98@yahoo.com
|
|
|
|
|
|
You are a moron
1 - vb.net is not a useful subject
2 - if you can't read the forum, don't expect a reply, putting your email in public only gets you spam
3 - your question makes no sense, but I suspect it's trivial. Buy a VB.NET book and read it
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i have the code below
MsgBox(Me.tbtitle.Text)
My.Settings.ArrayName.Add(Me.tbtitle.Text)
the "Me.tbtitle.Text" has "moo" in it, but when i do the above value in the settings say that i put a null value in, the msgbx confirms the value "moo" before it add it, also ArrayName is a array list with the scope set to user
plz help
J.Hardy
|
|
|
|
|
This made no sense at all. Are you saying that when this code executes, it's not putting the value of the Text property in the array?? How are you determining this??
|
|
|
|
|
basically if i put this
My.Settings.ArrayName.Add("moo")
it returns:
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object.
J.Hardy
|
|
|
|
|
dont worry i fixed it i just had to put
My.Settings.ArrayName = New ArrayList
but thanks for your help
J.Hardy
modified on Wednesday, March 4, 2009 2:04 AM
|
|
|
|
|
I am doing a project where i recieve data through a RFID reciever and planning to extract the data on hyper terminal. I have heard their are com based files aviable for this . Is there some way so that i can get the data from Hyper Terminal to VB or VB.Net.
|
|
|
|
|
WHy are you bothering with HyperTerminal when .NET 2.0 has the SerialPort class to support communication over the serial ports?
|
|
|
|
|
Hi,
We done one application in .net 2005 and used (sql server, web services and reflection).
Now we want to migrate the application to frame work 3.5.
Please let me know if any deprecated methods and what should i take care
Please guide me to analyse the impact of this migration
Thanks in Advance
|
|
|
|
|
You can safely assume that if it runs in 2.0, it will run under 3.5 - the 2.0 framework is "embedded" in the 3.5 framework, so to speak
I are troll
|
|
|
|
|
Thanks for the soon reply
|
|
|
|
|
If you use IEnumerable<t>s and other collections, you may also want to take a look at LINQ. Applied correctly it makes life much simpler
|
|
|
|