|
Have you figured out if this is possible?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Well it appears to be possible but I didn't get it working perfectly yet
I'm able to create an activx componont (in vb.net)
then I can import it in access (2007,2003) but I'm unable to set it's property's, not in code and in design I can set them once just after I put the control on the form but after that I can't change them they always revert back to there original value's
but due to lak of time I hade to put this 'project' in the freezer for a while so...
|
|
|
|
|
TDDragon wrote: due to lak of time I hade to put this 'project' in the freezer for a while so...
That's a bummer.
TDDragon wrote: I'm unable to set it's property's, not in code and in design I can set them once just after I put the control on the form
Hmmmm, is the visiblity of the properties non readonly outside the component?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I don't remember specificly but I think I'v tried every kind (public,friend,protected,...)
If I have some time I'll continue the search for an answer
|
|
|
|
|
Hi all,
I am working with webservices and its security.
I have a webservice and client application.now i need to secure the web service while calling and as well as serving the
request.
I tried using x509certificate but i didnt find luck.
Now, i want to use Kerberos token for providing security...
Can any one help me in giving security to the web serive
Thanks in advance......
|
|
|
|
|
Please stop spamming the entire site.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i want to create control array in vb.net in runtime or design time help me
sathish
|
|
|
|
|
what do you mean exactly.
from what I understand you could do it with the list variable.
example:
dim l as list (of button)
dim l as list (of textbox)
dim l as lizt (of control) (don't know how/if this will work though)
|
|
|
|
|
exactly i want create control array like vb like example: textbox(0) in runtime or at design time
sathish
|
|
|
|
|
Then I would use the list
example code that creates a list and fills it with 20 textbox
Private l As New List(Of TextBox)
Private Sub filltextbox()
Dim i As Integer = 0
Do While i < 20
Dim txt As New TextBox
txt.Text = "test" + i
l.Add(txt)
i += 1
Loop
End Sub
|
|
|
|
|
it is very useful but i want to access textbox values using there index value and in this the textbox names are different why ?
sathish
|
|
|
|
|
don't really know what you mean
the textbox names aren't different I just added text to it as a way to show how to access te property's
If you want to access the textbox with index value you could always give that index value along with the textbox.tag property and then loop true the list untill you find the right textbox
|
|
|
|
|
There is no design time support for creating control arrays. Here is some code that demonstrates a few different approaches.
Public Class Form1
' An array of textbox's
Private ControlArray As New List(Of TextBox)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Here I am adding TextBox's that already exist on my form to the array
With ControlArray
.Add(TextBox1)
.Add(TextBox2)
.Add(TextBox3)
End With
' Loop through each textbox in the array
For Each tb As TextBox In ControlArray
MsgBox(tb.Name)
Next
' Access a textbox by index
MsgBox(ControlArray(1).Name)
' Here I am creating textboxes dynamically and adding them
' to the array
For i As Integer = 0 To 2
' Create a textbox
Dim tb As New TextBox
' Set it's position
tb.Location = New Point(20, 10 + i * 30)
' Set it's width
tb.Width = 100
' Add the textbox to the array
ControlArray.Add(tb)
' Add the textbox to the form
Me.Controls.Add(tb)
' Add handlers for the GotFocus and LostFocus events
AddHandler tb.GotFocus, AddressOf TextBox_GotFocus
AddHandler tb.LostFocus, AddressOf TextBox_LostFocus
Next
' Here I've looped through the forms controls and found
' all the textboxes and added them to the array
' This is a good approach if you have many controls you added at
' design time but don't want to manually add each one to the array.
' The desired event handlers can also be dynamically added this way
For Each ctrl As Control In Me.Controls
Dim tb As TextBox = TryCast(ctrl, TextBox)
If tb IsNot Nothing Then
ControlArray.Add(tb)
End If
Next
End Sub
' Handles the textboxes GotFocus event
' I've handled the controls I created at design time by including them after the handles keyword
Private Sub TextBox_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.GotFocus, TextBox2.GotFocus, TextBox3.GotFocus
' tb is a reference to the textbox that raised this event
Dim tb As TextBox = DirectCast(sender, TextBox)
tb.BackColor = Color.Wheat
End Sub
' Handles the textboxes LostFocus event
' I've handled the controls I created at design time by including them after the handles keyword
Private Sub TextBox_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus, TextBox2.LostFocus, TextBox3.LostFocus
' tb is a reference to the textbox that raised this event
Dim tb As TextBox = DirectCast(sender, TextBox)
tb.BackColor = Color.White
End Sub
End Class
|
|
|
|
|
thanks for your help and another thing that i want to known textbox name which currently active. i could not get it name from MsgBox(Me.ActiveControl.Name) this command why ?
thanks
sathish
|
|
|
|
|
Me.ActiveControl will give you a reference to the control that has focus. The problem I'm guessing is your code resides in a button click event. If you click the button it gets focus so Me.ActiveControl.Name will return the buttons name. What exactly are you trying to do? Can you describe the program a little?
|
|
|
|
|
the problem is Me.ActiveControl.Name does not display any name that's only i asked why ? and i want to known which textbox is currently active
thank you
sathish
|
|
|
|
|
I showed you code to dymanically create textboxs, is that how these textbox's were created or were they created at design time? Controls created at design time are given a default name, however, controls created at runtime are not. When you create the textbox you need to set it's name property. This is one reason why 'Name' may not be returning anything.
|
|
|
|
|
My DataGrid has two columns: "ID" and "Name". I want to sort on the "Name" when the form is loaded. How can I do it? thanks.
|
|
|
|
|
hi,
use following statemet for sort the datagridview
dg1.Sort(columnName,System.ComponentModel.ListSortDirection.Ascending)
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Hi, I bind a DataTable to a DataGrid. The DataGrid contains one column -- "Name". The DataTable has two columns -- "ID" and "Name". When the user selects a row in the DataGrid, how can I get the "ID" value from the DataTable?
Dim index As Integer = Me.dgdPersons.CurrentRowIndex
Dim oRow As DataRow = dsSearch.Person.Rows(index)
Dim ID As String = oRow("ID")
It works fine at the beginning, but if I click on the header of the "Name" column, the order of the rows is changed, and my code does not work then.
|
|
|
|
|
one way of doing this would be to give you're datagrid 2 columns and define the first column (ID) as index value or something like this (this will hide your column but you can still acces it from code)
another way would be to again make 2 columns but just make the width of the ID column 0
Hope this helps
|
|
|
|
|
Hi all,
I want be able to enable and disable navigation buttons when on the first or
last row of a DataGridView object.
I have a populated DataGridView and two buttons - "First Row" and "Previous Row"
If the user clicks "First Row", they are taken to the first row in the DataGridView via:
Private Sub btnFirstRecord_Click(...) <br />
' Move to first record in job list <br />
dgvMyRecords.CurrentCell = dgvMyRecords.Rows(0).Cells(0)<br />
End Sub
What I then want to to is disable the Prev Row button like this...
Private Sub dgvMyRecords_SelectionChanged(...)<br />
If dgvMyRecords.CurrentRow.Index = 0 Then <br />
btnPrevRow.Enabled = False<br />
Else <br />
btnPrevRow.Enabled = True <br />
End if <br />
End Sub
The problem is... this works if the user selects the first record using the mouse,
but not if the first record is selected through the code using CurrentCell.
If I click on the first row, SelectionChanged gets called AFTER the row gets changed.
If I set dgvMyRecords.CurrentCell to dgvMyRecords.Rows(0).Cells(0) (ie. select the first
row via code), SelectionChanged gets called, but BEFORE the row gets changed !?!?!?
Can anyone show me how to do this ?
cheers,
Matt.
|
|
|
|
|
Try using the DataGridView CellEnter event rather than the SelectionChanged event to toggle your navigation buttons.
|
|
|
|
|
Thanks Thomas... thats done the job nicely!
Still have issues with the SelectionChanged behaviour though, but you've given me a workaround...
cheers,
Matt.
|
|
|
|
|
A simple problem to solve I'd assume; I'm using MAPI to manipulate messaging. I have set up a profile in Outlook Express, and I can send email using my application. When I send to myself, it goes straight into my profile's inbox: Hotmail. However, When I use MAPIMessages1.MsgCount, it returns 0, as it reads from the default LOCAL folder. Any ideas on how to get my messages read from my new account?
|
|
|
|