Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Equivalent Functionality for .NET regarding Forms

Status
Not open for further replies.

wizarddrummer

Programmer
May 6, 2004
17
0
0
US
Greetings,

Here we go...
I'm new to .NET.

I have created a new project (vb Windows Application)

Now I can't seem to find the commands/functions etc to get what I want to get done.

I want to be able to call the .NET app from another program. I want to pass an argument or parameter to the .NET application and set the state of a text box in the .NET app equal to the passed arugment. (plus some other things)

I put together an example that works in ACCESS which appears in question 2

(Question 1)
Text box control:, what are the .NET equivalents to…
Events:
BeforeUpdate
AfterUpdate

(Question 2)
What do you have to say in .NET to achieve the following functionality in a Form. The code snippets are what I am interested in achieving:)

Code:
Private Sub cboFooBar_AfterUpdate()
    Me.txtFoo = Me.cboFooBar.Column(0)
    Me.txtBar = Me.cboFooBar.Column(1)
End Sub

Code:
Private Sub Form_Open(Cancel As Integer)
Dim strFill As String

    Me.txtCmdArg = Me.OpenArgs

    strFill = "A;Alpha;B;Bravo;C;Charlie;D;Delta;E;Echo;F;Foxtrot;"
    Me.cboFooBar.RowSourceType = "Value List"
    Me.cboFooBar.RowSource = strFill
    Me.cboFooBar.Requery
    Me.cboFooBar = "A"
    Me.txtFoo = Me.cboFooBar.Column(0)
    Me.txtBar = Me.cboFooBar.Column(1)
End Sub

I hope there is someone out there that can help.

Even if you're not sure … take a stab at it you might just be correct.

Regards,
wiz
 
1. no real equivalents
validated,lostfocus,leave,textchanged for afterupdate
gotfocus,enter for beforeupdate

2. what you want to do is make a datatable with two columns bind it to the datasource set the valuemember and displaymember and the .selectedvalue will give you columns(0) and the text or selecteditem or selectedtext will give you the columns(1) you used in your access example. And before you ask vb.net has no multicolumn combobox included.

you could also use additem but I think it's less flexible.


Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
YIKES!
Thanks, Christiaan Baes, for your response. It would appear in many instances that .NET is a step backward :(
But, buy golly, I can enter the word "form" in the Help Search and get 500 listings. That's a good thing right?

wiz

.NET is what you get when you have Alfred E. Neuman as Chief Software Architect.
 
wizarddrummer said:
It would appear in many instances that .NET is a step backward

This statement is entirely untrue. .Net is fully object oriented. VB6, VBA, etc. are not. There is no comparison regarding which language is more powerful.

The statement Me.cboFooBar.RowSourceType = "Value List"
clearly demonstrates the non-OO principles of the Access VBA. In .Net, you generally don't "remember" a specific string and use it as a property. What you want to do is create an array of string objects and set the datasrouce of your combobox to that array.
 
This statement is entirely untrue. .Net is fully object oriented. VB6, VBA, etc. are not. There is no comparison regarding which language is more powerful."

I would agree and disagree at the same time. Although I completely agree about .Net being completely OO and much more powerful then VB, I also beleive that some of the base objects that are included in .Net are either poorly designed or not intuitive. And many of those objects are all due to perceptions. Me personally, I loved the small number of objects that ADO had, I wished there was more flexability in it's use, but I still feel that it's a great base and added functionality can be created by us. On the other hand ADO.Net just agravates the hell out of me. The only reason I can put up with it is because .Net is OO and I can bury the ADO.Net objects deep in custom base data objects, and never have to deal with it.

-Rick

----------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top