|
Ok,I got this figured out you have to check the Microsoft Access 9.0 Object Library in the tools/references.
|
|
|
|
|
hello friend...
just send me any mail id so that i can send u the zip file....that might solve ur problem
With Regds
Vipin Bokariya
|
|
|
|
|
I normally code in C#, but I'm currently using VB.net for one of my projects. I have the option "Allow me to edit VB source code files while debugging" checked, but cannot do so. I get the message "Cannot currently modify this text in the editor. It is read-only." Does this feature not work with VB.net? Than doesn't seem likely, since the option is given. I do not have the same problem when using C#.
What am I missing?
Charlie
Here I am. Love me.
|
|
|
|
|
I'm using VS 2K3 and don't have that problem. All I did was check the Tools/Options/Debugging/Edit and Continue/'Allow me to edit VB source code files while debugging' box, restart VS and everything worked! BUT!!! It will only allow you to edit the files during a breakpoint! You can't edit the files while your code is actually running. You have to stop the code at a breakpoint first.
RageInTheMachine9532
|
|
|
|
|
Thanks for the response.
That's a little disappointing. I'm used to being able to edit the source code whenever I please, no matter the state of the app.
Oh well, such is life, I guess.
Charlie
Here I am. Love me.
|
|
|
|
|
I can open up to 5 Webbrowser controls on 5 separate forms. A medium size panel control on each form is transparent. I can only open up to 3 forms before memory is exhausted. As a test, when I eliminate the transparency I have opened the same form up to 50 times without any problems.
Has anyone else run into this problem using the TransparencyKey? I can’t find anything at MS on memory consumption and the transparencyKey property.
Thanks, GregC
|
|
|
|
|
as topic, if i wan to create an array where the content of the array can be edited by form1 and form2, how i going to do it?
for example the content of array is {1,2,3}
form2 change the content to {1,2,4}
form1 also can see the changes in the array
where i should declare the array and wat is the format?
and how am i going to call the array in form1 and form2 for modification?
any help is greatly appreciated...thz...
|
|
|
|
|
how t to draw 3D or 2D charts in VB.net programatically.
i know how to draw it by adding it at design time.
Nothing ...........................................................
|
|
|
|
|
as topic, how do i check the data type (integer and string) of the user input in a textbox??
if i wan the user to input number 123, but he/she entered 123A, how i going to detect there is an error of input?? any help is greatly appreciate...
|
|
|
|
|
Try something like:
Dim MyInteger As Int32
Try
MyInteger = Convert.ToInt32(Me.TextBox1.Text)
Catch fex As FormatException
' Do something here to handle the input being wrong
' like "123A"
Catch oex As OverflowException
' Do something here to handle the input being out of
' range (i.e. It is a number but is it too big for
' an 32 bit integer.
End Try
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
thanks again for help
this solution is works for checking integer, but seems like doest work on character?
i need to check a user input whether it is charecter type...
ur help is greatly appreciated...
|
|
|
|
|
Sorry, I'm don't quite understand. I thought you wanted to check that the input was an integer. Is this another control you want to check? Can you be more specific about what you need it to do.
Thanks.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
One way to validate user input is using regular expressions. Regexes can get pretty complicated if you need them to do more advanced validation, but simple things like making sure only numbers are input are simple enough.
This test looks for the beginning of a line, followed by one or more numbers, followed by the end of the line:
Imports System.Text.RegularExpressions
<br />
Dim re as new Regex("^\d+$")<br />
If re.IsMatch(myTextBox.Text) Then<br />
'Input passed the test<br />
Else<br />
'Failed<br />
End If<br />
To accept only non-numbers: "^\D+$"
To accept only strings in the format 123A: "^[\d]{3}[A-Z]$"
There are more variations than you can shake a stick at. You could, for example, make sure input is in the format of a US social security number or a phone number or a URL or whatever else you can think of.
Charlie
Here I am. Love me.
|
|
|
|
|
thanks for help
what if i wan to accept only character A-Z and a-z ?(no included symbols such as @#*%_)
wat is the regularexpression format?
To accept only non-numbers: "^\D+$"
this format accept only character but it also accept symbols which i dun wan be included...
ur help is greatly appreciated...
|
|
|
|
|
Anything in square brackets will match one character. The hyphen specifies a range. For example, [a-m] will match 'a' or 'g', etc., but not 'n' or 'A' (It's case sensitive, although there's an \i switch to compare in a case insensitive manner.) So [a-zA-Z] is what you're looking for. \w is similar, but also matches _ and 0-9
Mastering Regular Expressions[^] by Jeffrey E. F. Friedl is a great book about regexes. The author uses perl for the bulk of the book, but there is a section specific to .net and .net uses mostly perl flavored regexes, anyway. (Though in an OO way). If you don't use them enough to justify purchasing a book, VS.Net's online help has quite a bit of info on them.
Charlie
Here I am. Love me.
|
|
|
|
|
the default setting of combo box enable user to edit the listed in combobox just like normal textbox, but i cant find any property that can disable this option, i wan the combobox to be read-only to user...how i going to do that?? anyone can help me??VB.Net
|
|
|
|
|
Try this:
Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
Or just set it in the designer.
The defintions for ComboBoxStyle are:
DropDown The text portion is editable. The user must click the arrow button to display the list portion.
DropDownList The user cannot directly edit the text portion. The user must click the arrow button to display the list portion.
Simple The text portion is editable. The list portion is always visible.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
thanks man, ur solution works!
however seems like the combobox will no default value when form loaded, the combobox is empty
how i going to set the first item in the combobox to be the default item when form is loaded?
|
|
|
|
|
Use SelectedIndex or SelectedText
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
thanks man, u helped me alot, i am a beginner in vb.net
hope the questions i asked wont make u feel boring...
|
|
|
|
|
ok, I'm completely new to VB and have come up with a problem on something that I think it really easy.
What I have are 2 forms, form1 and form2. Form2 gets called from a context popup on a listview on form1. Now, on form2 I have a textbox variable that I want transfered back to the listview on form1 when you click on the OK button on form2. However I am unable to access the listview on form1 from form2. I figure it's a scope issue. I have found a work around on MSDN that works, but to me it seems wrong.
Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem6.Click
Dim frmAction As New fclsRoomAction
frmAction.ShowDialog()
lstRoomAction.Items.Add(frmAction.tbActionDesc.Text)
End Sub
Here I have called my 2nd form, but I set my listview with the variable AFTER I have closed the form. Just dosn't seem right to me because I have closed the file BEFORE I read my variable. I think this has something to do with the way .net does garbage upkeep. I'm not sure. Like I said I'm new to this.
So... Now I ask. Is this the standard way of passing variables between forms or is there a more elegent way of doing it. I was originally hoping to be able to do it on form2 as there I can create 2 buttons, accept and cancel, which determine whether I copy the variable over or not. But as I cannot access my listview on form2 I was unable to do this.
Hopefully this makes sense. Thanks.
Randy.
|
|
|
|
|
The general way I'd do this would be to create a property for each value that I want to expose on Form2. Create an event handler for the Closing event and populate the values that the propery will expose.
e.g.
'The value to return to the other form
Private myValue As String
' This is the propery that exposes the value needed by
' the other form
Public ReadOnly Property ValueForOtherForm() As String
Get
Return Me.myValue
End Get
End Property
' When the Form closes ensure that the value is transered so
' that the property works.
Private Sub Form2_Closing(ByVal sender As Object, _
ByVal e As System.ComponentModel.CancelEventArgs) _
Handles MyBase.Closing
myValue = Me.tbSomeControl.Text
End Sub
Then, back in Form1, you can do this:
Private Sub MenuItem6_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MenuItem6.Click
Dim frmAction As New fclsRoomAction
frmAction.ShowDialog()
lstRoomAction.Items.Add(Form2.ValueForOtherForm)
End Sub
I hope this helps.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
Thanks for the help. I'm pretty new to the oop aspect of VB, but I assume thats what you were describing there as I know that properties in objects have get/set.
So after spending some time reading up on objects and browsing your code, I understand whats going on, but it troubles me how I'm able to reference a variable from a form that dosn't exist anymore. It's been closed after all and all variable on that form should be gone. It just feel wrong for me to code like that. Is this how VB.net is normally done? Can't you reference a control (eg. textbox) that exists on form1 from form2 and put it directly into it's text property without having to create storage variables? I can't seem to get it to work. I must be missing something...
Randy.
|
|
|
|
|
MadCow wrote:
it troubles me how I'm able to reference a variable from a form that dosn't exist anymore
The form "object" exists, but the controls don't. One of the more difficult concepts to understand is that there is managed (that's .NET) and unmanaged (that's Win32 API) stuff going on. The .NET Framework hides most of the Win32 implementation but you do get the occasional glimps that it is there sitting in the background.
Let me try and explain better. The WinForms part of .NET Framework is a wrapper around the Win32 API which is what drives Windows. When the form is closed .NET cleans up all the controls by disposing of them immediately rather than wait for the garbage collector to do it. [The way controls work in Win32 mean there is actually limited space for them so it is very important to let the system know when you are done with them]. The Form object still exists, but the underlying (Win32) controls on it don't because .NET has told Windows they are no longer required. The managed things, like the exposed string propery do still exist because they have no unmanaged element.
MadCow wrote:
It's been closed after all and all variable on that form should be gone
Just because a form has been closed doesn't mean it doesn't exist. It just means that the User Interface part is, well, "Closed".
MadCow wrote:
Is this how VB.net is normally done?
Personally, I'd create a controller object to store all that stuff and access it from the various forms that need it. I don't know if this is going to be too much information to take in at this point, but you could also read this article about the Model-View-Controller pattern[^] on Microsoft's web site. It also has links to other related articles about how to write good software.
MadCow wrote:
Can't you reference a control (eg. textbox) that exists on form1 from form2 and put it directly into it's text property without having to create storage variables? I can't seem to get it to work
I'm guessing that you need to cast the variable referencing form1 into the correct type. You probably have the base class in the .NET framework and you need to cast it to the specific type to access anything that is added in the derived class.
I'm sorry that I am not able to recommend a good book on OO concepts, I learned all that stuff years ago and all I have is lecture notes. However the article mentioned above is in a section of the Microsoft Web site[^] that contains a lot of examples of good Object Orientation.
I hope all this helps and my length reply, and even lengthier set of further reading material has not put you off.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
Thanks for all of the help. I checked out those articles on Microsoft's site, but as you said, it's a bit beyond me right now. But I have it bookmarked and will go back to it in a few months.
I ended up just using the method that dosn't make me feel comfortable. I figure if it works I won't worry about it. The explanation that you gave for a form being closed, but not necessarily non-existant helped.
And I will look into casting my reference form object. You had it bang on when you said that I was trying to do stuff with my base class object. Right now I'm just working on other stuff and leaving that form stuff for a while. I need to work on something thats going to work for a change.
Thanks again for all the help! Take care.
Mooooo. Grrrr.. Mooo..
|
|
|
|