|
If you are just performing a new query and setting the results to the datagrid then in your routine where you set the datagrids datasource property, always set the datasource to nothing first.
Private Sub FillGrid(dg As DataGrid)
Dim ds As New DataSet
'//Clear Any Data From The Grid
dg.DataSource = Nothing
'//Do Work To Get Data Here
'
'
'//Fill The Grid With Data
dg.DataSource = ds
End Sub
Just An Example. That way your really only had to add one line of code to clear the grid and scrollbar.
|
|
|
|
|
Thank you so much! That did exactly what I wanted and it elminated the need for an extra subroutine.
|
|
|
|
|
|
How can I enumerate a control's properties in .Net?
I bascially want to do this (vb6 code):
*****Start Code*****
ctl = control
strPropName = "value"
For each prop in ctl.properties
If propr.name = strPropName
msgbox prop.value
Exit For
End if
Next prop
*****Start End*****
I'm struggling with this, as it was obvious in VB6!
Thanks
|
|
|
|
|
Use Control.GetType to get the Type of the control, and Type.GetProperties to get an array containing the properties of the control.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Is there any one know how to set the text file to be printed on next new page? I mean if i read certain line contain string start with "*", then i want the line below "*" to be printed on next page.
Any one know how to do this?
|
|
|
|
|
yea use an else if statment to check for more pages. email me if u need more help. pschutt@rxcci.com
|
|
|
|
|
This probally is the stupidest question but I am new to Microsoft VB .Net, and I need help. I know where to put it but I don't know what to put. I just want a sound to play when my Application starts.
|
|
|
|
|
Can you do it in a macro?
WindowEvents_WindowCreated? Oh wait .... in the application your writing(not the enviorment... Ughh)
Yeah - Option One, in your main window load event, Making sure to play it only once.
Option two, have a main function that plays the sound and then loads the form. Make sure you set the startup object to be the main function you just wrote. Just like in VB classic.
|
|
|
|
|
I have been working with VB.NET for a few months coming from vb 4 5 and 6. I have enjoyed the control that I have over the execution on my programs and the level of detail available throught he framework. However, I seem to have a thorn in my side whenever I utilize the datagrid. Indexoutofrange exception seems to pop up out of knowhere and for the life of me I can not properly trap it or handle it in debug mode. I have gotten around other exceptions, has anyone else experienced this? is there something that I would be overlooking or a way to trap.
Thanks
Gregory J Lynch
Hack
|
|
|
|
|
I compiled a DLL using Visual Basic 6. I am unable to call this DLL in OMNIS.
I was told that if a DLL is compiled in VB 6, it is highly likely to be compiled as a COM object. Omnis functions will not work with COM objects.
How do I compile a DLL in VB 6 as a normal DLL?
Can somebody help me out??
Regards,
Vick
|
|
|
|
|
This cannot be done using VB6 alone, which creates only stand-alone EXEs or COM components. Desaware, however, has a product called SpyWorks, that will create Win32 exports of VB DLLs.
http://www.desaware.com/SpyWorksL2.htm
|
|
|
|
|
vicknesh wrote:
I was told that if a DLL is compiled in VB 6, it is highly likely to be compiled as a COM object.
That is correct.
-Nick Parker
|
|
|
|
|
Hi
How do i disallow a user from entering MBCS characters (Japanese Kanji) from entering in text box.
He/she should only be allowed to enter SBCS (KataKana) in the text box.
Help!..
|
|
|
|
|
|
USe StrCon() function ofVB.
USe it to convert to any type.
i.e VBWide,VBNarrow,VBKatakana,VBHiraGana. etc..
USeful-function,if u get it right.
else VB stores strings in UNICODE format which takes 2bytes / character.
So difficult to recognise single/multibyte otherwise.
CIAO
|
|
|
|
|
MCLHotkey.Net - A .NET system-wide hotkey component
===================================================
To use, add the component to a windows form and set the properties
to describe what key combination will trigger the hotkey. Once
running, the HotkeyPressed event will be triggered whenever that key
combination is pressed, system wide.
Version 1.1 (Beta)
Known issues:
* The component properties do not set correctly through the front
end - only a portion of the possible VKey values are shown
* ShiftKey modifier is not set correctly
Download from
http://www.merrioncomputing.com/Download/MCLHotkeyNet.zip - source
code included.
Any suggestions/comments/bug fixes?
Thanks in advance,
Duncan
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Does anyone know how to trap events from objects in a collection? I have being trying to use delegates, but it's not trapping the events. Was this an oversight printed in the Core Reference, or is their some other trick to it?
|
|
|
|
|
I must be missing something in your problem statement, but here's what I'm thinking. If you add an event handler to an object and that object fires the event, your event handler will execute. Subsequently adding the object to a collection has no impact on the event mechanism.
Are you trying to work with events raised by the collection itself, such as when items are added or removed?
|
|
|
|
|
Hello,
It's me again.
I am using the .NET IDE.
I am wanting to get a little information and insight about the best approach to accomplish something. I am wanting to integrate an MP3 recorder into an application. It needs to work simply. I want to pass a filename for the mp3 file, click the record button, when done click the stop button, then click the save button. No option to rename it. The program will handle the naming of the file. This will be used by a doctor and needs to be as simple as possible. The only user interface that will need to be implemented in the mp3 player/recorder should be only what a tape recorder is capable of. What is the best route to use? Are there some components in .NET that will enable any of this? Is there any API function call that can be used? A utility to integrate? The reason it needs to be MP3 is because of filesize. We will be dealing with up to 15 minute voice recordings. Any starting suggestions would be greatly appreciated.
Thanks,
Kendal
|
|
|
|
|
I'm teaching myself VB.NET and have come across a problem with either the tutorial book (Visual Basic .NET Programming with Peter Aitken, Chapter 9, page 191) or the software (Microsoft Visual Studio .NET).
The problem I'm getting is after typing in code from example in book:
Public Class UseOverloadedConstructor
Private pName as String
Public Overloads Sub New(ByVal Val As String)
pName = Val
End Sub
Public Overloads Sub New()
pName = ""
End Sub
Public Property Name() As String
Get
Name = pName
End Get
Set(ByVal Value As String)
pName = Value
End Set
End Property
End Class
I get an error in the build. Saying that Overloads don't work with New!
What is the problem? What am I missing?
Can anyone help?
Thank you
|
|
|
|
|
you cant use New as an overloads sub , change the name of the sub :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MyNew("my string")
'/// set the text to the name
MsgBox(TheName) '/// check TheName now contains the correct info
End Sub
Private pName As String
Public Overloads Sub MyNew(ByVal Val As String)
pName = Val
End Sub
Public Overloads Sub MyNew()
pName = ""
End Sub
Public Property TheName() As String
Get
TheName = pName
End Get
Set(ByVal Value As String)
pName = Value
End Set
End Property
switch(twinsOnWay)
{
case ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
break;
|
|
|
|
|
Thank you for your help.
I appreciate it very much.
Congratulations on your new additions to your family too!
|
|
|
|
|
Constructors don't need to be explicitly overloaded like other methods. You can simple create all of the New methods (constructors) you want, as long as they have unique signatures. If you rename the method to something like MyNew, it becomes an instance method and will not be used as a constructor.
|
|
|
|
|
Thank you very much for helping me. You have given a better look at the way Contructors work. I just wish the book I bought had been better informative. I guess you get what you pay for. Thanks again!
|
|
|
|