|
EventSelect.SelectedValue.ToString
SqlCommand.CommandText = "[DeleteEvent]"
Can you explain what EventSelect and [DeleteEvent] mean? Which event are you referring to?
Gymnast.
|
|
|
|
|
Hi everybody!
I'm developing a VB.NET 2005 application and I want to use a DataGridView, but I need to disable navigation, so I've been looking for a property like AllowNavigation (like the old DataGrid had) but I don't seem to find it. Is it that the Mycrosoft team removed this property for the new grid?
If somebody knows how I can achieve the same as AllowNavigation but for DataGridView, please, let me know.
Thanks in advance
Kenia
|
|
|
|
|
I've only worked with vb.net 2005...so what do you mean by disable navigation? Or what did the AllowNavigation property do?
|
|
|
|
|
What the property does is to allow the user to select whether to show or not links to child tables. If you know how to achieve this in the DataGridView control, please, let me know.
Thanks,
Kenia
|
|
|
|
|
Dear All,
I am new with VB coding, please help me with this problem.
I have a form including 1 input field, 1 dropdown menu and 1 submit button.
The scenario is:
If I dont move the mouse to the inputfield, and select a dropdown menu. It will automatically activate the submit button to update info. However, in this process, I want it ignore the data in the input field, and update only the item in the dropdown menu.
Could you please help me, i 'm being stuck in this issue for 2 weeks.
I would appreciate your time and your potential helps very much,
|
|
|
|
|
I used to have a good article saved in my favorites about this issue, but the link is no longer active. Here is another one I had saved:
http://weblogs.asp.net/Jeff/archive/2005/07/26/420618.aspx[^]
And you may find more about this by searching for the key words "ASP.NET Default Button" on google or CP.
Hope this helps.
|
|
|
|
|
Hi,
I have 2 proj-a user control project and a web page project(huge web site).
Currently using web deployment, I am creating a dll file for user control project. Then I am referencing this to web page project and build and debug to view the changes in web project.
To avoid this long process, I am trying to build a batch file to build both.
I am able to build the usercontrol using msbuild in the batch file.
Now I am not able to reference this dll file to webpage project and build the web page project using devenv.How do I reference dll file to webpage project in command prompt or in a batch file. Please help
|
|
|
|
|
Travelthrprog wrote: Now I am not able to reference this dll file to webpage project and build the web page project using devenv.
Why not?? All you have to do is add the .DLL project to your web page project in the same solution, then you won't have this problem at all.
|
|
|
|
|
Hi Dave,
I am able to run it manually. But I want to create msbuild .proj file to do it. I just tried building only proj2 by referencing the proj1.dll file as shown below
<project defaulttargets="Compile" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<propertygroup>
<appname>C:\2proj
<optimize>false
<itemgroup>
<inclibs include="C:\1proj\debug\bin\1proj.dll">
<target name="”Compile”">
<target name="”Compile”">
<msbuild projects="C:\2proj" target="c:\2proj\2proj.sln" "="" references="”@(incLibs)”">
But gives an error
Msb4025-invalid characters in the coding
I also don't know how to build the first proj and then add the reference it in the above code.
Please help.
Thanking you,
Nirmala
|
|
|
|
|
i have a form that is being populated with checkboxes added at runtime. VB6.
If Not rsEMPRTYPESSORTED.EOF Then rsEMPRTYPESSORTED.MoveFirst
Do While Not rsEMPRTYPESSORTED.EOF
cIndx = cIndx + 1
ctrlName = "DynChkBx" & CStr(cIndx)
prevctrlName = "DynChkBx" & CStr(cIndx - 1)
Set chkObject = frmEmployer.Controls.Add("VB.CheckBox", ctrlName, Frame3)
Set prevtxtObject = frmEmployer.Controls(prevctrlName)
With chkObject
.Enabled = False
.Visible = True
.Width = 2800
.Height = 255
.MaskColor = 1
.BackColor = &H8000000F
If cIndx = 1 Then
.Visible = True
.Caption = rsEMPRTYPESSORTED!Name
.Top = 10
.Left = 10
Else
.Visible = True
.Caption = rsEMPRTYPESSORTED!Name
.Top = prevtxtObject.Top + prevtxtObject.Height
.Left = 0
End If
End With
rsEMPRTYPESSORTED.MoveNext
Loop
As you can see i don't know the number of controls or the names.
what i need is to attach events to these controls.
I have tried the withevents but as you know it only works with the last control and cannot be use in an array.
all the controls are intrinsic therefore VBControlExtender is out.
modified on Tuesday, February 19, 2008 1:12 PM
|
|
|
|
|
You have to wire-up the events yourself. Lookup AddHandler and RemoveHandler in the MSDN docs for examples.
|
|
|
|
|
Thank you for your response...however i need to be able to accomplish this in vb6.
|
|
|
|
|
the only way to really do this in vb6 is to have a control array. no matter how many checkboxes you create they all will call the same routine passing the index of that one that's changing. then you can test the index to know whether or not to have happen when changing values...
<br />
Private Sub Check1_Click(Index As Integer)<br />
If Index = 0 The<br />
.<br />
.<br />
.<br />
End If<br />
End Sub
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
There is no equivilent in VB6.
It's been about 7 years since I've used it, so I can't remember how you had to do it. I think you have to create a control array with a known name, then add to that array when you wanted to add controls to it. The event handler had to have the same name as the control array in order to get wired up. ... I think ...
|
|
|
|
|
Thanks again for everyones input.
If i were to use a control array for the checkboxes...can i still use the 'controls.add' to add new members to the array and to frame3 as in 'Set chkObject = frmEmployer.Controls.Add("VB.CheckBox", ctrlName, Frame3)'...? I do not believe that the 'load' statement will accomplish this.
Ultimately, I want to add the checkboxes to frame3 (it has a specified height at design time) and then scroll the checkboxes within it (frame3) if the total height of all checkboxes gets to be > the height of the frame, then catch the individual click events. an array will accomplish the click event problem but i dont know if I can still add them to the scrolling frame without using 'controls.add'.
|
|
|
|
|
lesstraveled wrote: If i were to use a control array for the checkboxes...can i still use the 'controls.add' to add new members to the array and to frame3 as in 'Set chkObject = frmEmployer.Controls.Add("VB.CheckBox", ctrlName, Frame3)'...? I do not believe that the 'load' statement will accomplish this.
The Load statement has nothing to do with creating controls.
Under VB.NET, you can do something like:
Dim newControl As New CheckBox
' setup the properties of the control here...
Me.Controls.Add(newControl)
I think you can do the same thing under VB6, or something very close to it.
<blockquote class="FQ"><div class="FQA">lesstraveled wrote:</div>but i dont know if I can still add them to the scrolling frame without using 'controls.add'. </blockquote>
How about trying it to see what happens??
|
|
|
|
|
you can do something like this to put the controls in the frame.
Dim i As Integer
Set Check1(0).Container = Frame1
Check1(0).Top = 10
Check1(0).Left = 10
For i = 1 To 10
Load Check1(i)
Set Check1(i).Container = Frame1
Check1(i).Left = 10
Check1(i).Top = Check1(i - 1).Top + Check1(i).Height
Check1(i).Visible = True
Next
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
nlarson11...'Set DynChkBx0(0).Container = Frame3'---perfect, that was exactly what i was looking for. Thank You!
|
|
|
|
|
Would anyone be kind enough to assist me with an issue i am having binding the user input through Radio buttons to a field (ExemptStatus) in my access database?
Dim grbExemptStatus As String
'declare radio buttons for Exempt values
If radNonExempt.Checked = True Then
grbExemptStatus = "Non Exempt"
End If
If radExempt.Checked = True Then
grbExemptStatus = "Exempt"
End If
On my User Form, I have a "Exempt" & "NonExempt" within a groupbox called "Exempt Status". I would like the user selection to be passed to a my access database; tblEmployee; fieldname = ExemptStatus. I have tried user Select case as well as If checked = true, but none of that is producing the desired result. Instead the value passed to my table is "exempt status?. Please help! TIA
modified on Tuesday, February 19, 2008 12:27 PM
|
|
|
|
|
You're not making the problem very clear to me, but i think you need code like:
Dim ValueToPass as String
if ExemptRadiobutton.Checked = True then ValueToPass = "Exempt"
if NonExemptRadiobutton.Checked = True then ValueToPass = "NonExempt"
Then send ValueToPass to your dataset.
Does this help?
|
|
|
|
|
Sorry, I didnt make the issue clearer. The code i used is exactly as you suggested, but I am not getting the desired result. Instead of getting the values "Non Exempt" or "Exempt", I get "Exempt Status" which is the text value of the groupbox.
'declare radio buttons for Exempt values
If radNonExempt.Checked = True Then
grbExemptStatus = "Non Exempt"
End If
If radExempt.Checked = True Then
grbExemptStatus = "Exempt"
End If
strEmployee = "INSERT INTO tblEmployees(" & _
"EmployeeNumber, FirstName, LastName, " & _
"HireDate, ExemptStatus, " & _
"Title, BaseSalary) VALUES('" & _
txtEmployeeNumber.Text & "', '" & txtFirstName.Text & _
"', '" & txtLastName.Text & "', '" & _
dtpHireDate.Value.ToString("MM/dd/yyyy") & "', '" & _
grbExemptStatus & "', '" & _
txtTitle.Text & "', '" & txtBaseSalary.Text & "')"
|
|
|
|
|
You have somewhere:
Dim grbExemptStatus as string = ""
and yet...
Console.writeline (grbExemptStatus) produces "exemptstatus"?
If so, I'm not sure what's going on.
|
|
|
|
|
Great!
Your last response provided the clue. Its now working.
Instead of:
Dim grbExemptStatus as string = ""
I had
Dim grbExemptStatus as string
By omitting the = "", it would simply pass the text name to the database instaed of the underlying value.
Thanks a bunch!
|
|
|
|
|
I created a Windows app in vb that searches a database and returns counts that are displayed in a word document. Well, I can run the application just fine under my profile on my pc, but if I run it from another profile on my own box (a standard user) or if I run it under the admin account on my test box, I get the Object reference not set to an instance of an object error.
Now I can’t see just where to error lies because, like I said it runs fine for me. Any ideas?
|
|
|
|
|
Something you haven't counted on is happening, obviously. You need to put some kind of error trapping into your .exe which will help you see where the error is on the other accounts and machines. There were some posts on this late last week on this site.
|
|
|
|