|
A module is just an alternate way of declaring a NotInheritable class with only Shared members. One additional feature is that the members can be called without qualifying with the module name (unlike a shared class member).
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter and VB to C++ converter
Instant J#: VB to J# converter
Clear VB: Cleans up VB.NET code
Clear C#: Cleans up C# code
|
|
|
|
|
Is there any way to access all of buttons one by one thru loop but the buttons are not in a control array.
I have almost 40 buttons on a form and i need to make some of them enable and some of them disable at runtime by checking there names. I dont want to write the long code but the buttons are not in a control array...Is there any way out of this situation.
Thanx in advance
Noshaba
|
|
|
|
|
I'd possibly re-build part of the form so that the buttons are in a control array. Much easier and the resultant code will be cleaner too.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
I have got the solution of the problem....here is that for u also
Don't redesign the form rather use the following code:
Function fResetEntries(frm As Form)
Dim objObject As Object
Dim i As Long
For i = 0 To frm.Count - 1
Set objObject = frm.Controls(i)
If objObject.NAME = "cmd1" then
objObject.enabled = false
End If
Next i
End Function
isn't more easier and cleaner
Noshaba
|
|
|
|
|
noshaba mariam wrote: isn't more easier and cleaner
No, it's not. If you just looped through 40 buttons to find one, I can save you the trouble and get it down to just one line of code:
Button1.Enabled = False
You'd be much better off sticking the related buttons into a control array. Then you wouldn't have to waste all that time checking for a name. You could just do something like:
For i = 0 to 12
SomeButtons(i).Enabled = False
Next
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
OK - if you want - but it sometimes comes to the point where you need to refactor the code to make it more efficient, more readable and maintainable. It takes a little time to do properly but isn't that the whole point?
See Dave's answer to see how compact and easy the code becomes.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Hi All,
How can i add Placeholder in a datagrid. I want to repeat a placeholder inside the datagrid. Is it possible if yes how?
thanks
(I wanna know how to catch a fish.)
|
|
|
|
|
hello I want to create controls from coordinates that I have in a data base, as for example a label with properties text, tag.
But that this label is created agreed the coordinates not nesecariamente must be rectangle can be a trapezoid.
thanks for its aid
Juanjo
|
|
|
|
|
Check in these links
controls.add
http://www.codeguru.com/forum/showt...t=dynamic+label
control array
http://www.codeguru.com/forum/showt...t=dynamic+label
|
|
|
|
|
I have a datagrid that is recieving multiple columns of data. I want to make 1 specific column have bold type. I have managed to get this to work in tablestyles but the bold type only shows up when the datagrid cell has focus. I need the data in the specific column to be bold all the time. can anyone please help me figure this out.
thanks
|
|
|
|
|
Hi,
I'm currently writing a VB.NET Class Library that will be used by other developers. I need to provide descriptive comments about the methods I am making available such as Summary and Return Value etc. In VB6 I did this in the Tools>Attributes but we do not have this option in .NET.
Thanks in advance for any adivice!!
Ronny Flaatten
|
|
|
|
|
|
Thanks!! I was looking all over the web but could not get anything. This tools actually exceeds my original requirements, and it will go much farther than just adding comments to my Class.
Thanks again!
|
|
|
|
|
I'm glad I could help.
|
|
|
|
|
Hi,
I have a big solution contains some projects of vs 2003, now I want to generate some new projects in 2005 and add them into the solution. Is that okay I have both version in one solution?
Thanks!!
|
|
|
|
|
Hi
No it is not possible
regards
GV Ramana
|
|
|
|
|
VS 2005 sucessfully converts earlier solutions. Therefore, I advice you to use 2005 and load the previous solutions which were assumably created VS 2003. However, you will be facing with some certain corrections and modifications. It will be a big plus for you to come up with a clean code.
I had the same problem but now with 2005 my code is clean, more understandable and more simple.
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I'm trying to load an assembly from stream, this works fine.
But how do I use the assembly once loaded?
I just keep on getting a file not found exception in my code.
Any idees?
/Johan
|
|
|
|
|
Could someone please send me the code for creating a btree, and basic operations on a b-tree, like inserting and deleting keys in the nodes of b-tree using VB.NET. Please, i need it fast
Keshav v. Kamat
|
|
|
|
|
Hello All,
I'm having some trouble with this Web Service that I'm writing for work. The web service needs to sign incoming/outgoing requests with a valid X509 Certificate. I've written and tested the service here on my machine and it works fine with test certificates that I made via the makecert tool. My Company purchased a certificate from a well-known CA, but for some reason I can't get the Service to operate coorrectly with the purchased certificate. As far as I can tell it is installed correctly on our server (IIS 6.0). When I try to access the certificate programatically per the code below, I get an error that "the keyset does not exist". The private key file is there, I can pull it up with the WSE 2.0 Certificate tool and view the file, the permission are also correct, I'm logged in as Administrator with full control over all the directories/subdirectories.
CODE :
Private Function getSigningToken() as X509SecurityToken
Dim res as String = String.Empty
Dim securityToken As X509SecurityToken = Nothing
Dim store As X509CertificateStore = _
X509CertificateStore.LocalMachineStore( _
X509CertificateStore.TrustStore)
Dim open As Boolean = store.OpenRead()
Try
Dim certs As X509CertificateCollection = _
store.FindCertificateBySubjectName(cName)
Dim cert As Microsoft.Web.Services2.Security.X509.X509Certificate = _
CType(certs(0), Microsoft.Web.Services2.Security.X509.X509Certificate)
If cert Is Nothing Then
res = ("You chose not to select an X.509 " + _
"certificate for signing your messages.")
securityToken = Nothing
>ERROR HERE --> ElseIf (Not cert.SupportsDigitalSignature Or(cert.Key Is Nothing)) Then
res = ("The certificate must support digital " + _
"signatures and have a private key available.")
securityToken = Nothing
Else
securityToken = New X509SecurityToken(cert)
End If
Catch ex As Exception
res = ex.Message
Finally
If Not (store Is Nothing) Then
store.Close()
End If
End Try
Return securityToken
End Function
Do I need some special kind of certificate?
Shouldn't any type of X509 certificate work for signing soap request?
Any help at all is much appreciated. I've been searching the internet for a solution for about a week now. I've seen many who have this problem, but none have posted solutions (with the exception of security permissions, which I don't believe is my problem). Thanks in Advance for all your help.
|
|
|
|
|
|
Hello all,
I am using asp.net 2.0 GridView control. This grid is enabled Paging, i.e like this...
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)<br />
{<br />
GridView1.PageIndex = e.NewPageIndex;<br />
BindMessageGrid();<br />
}<br />
. This is working fine.
This Grid is having 3 columns(Name,Suject,Date) I am sorting the columns like this...
<br />
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)<br />
{<br />
int index = GridView1.PageIndex;<br />
DataTable dt = GetDataTable();<br />
DataView dv = new DataView(dt);<br />
<br />
dv.Sort = e.SortExpression + " " + GetSortDirection();<br />
GridView1.DataSource = dv;<br />
GridView1.DataBind();<br />
GridView1.PageIndex = index;<br />
}<br />
This Grid is showing 3 pages. When I click on first page first column(Name), first it is showing in Descending(i.e Z,Y...A) with same 3 pages.
Problem is here...
Now if i will go 2nd page. it is resetting the page.
my Problem is when click on firtColumn sort(by Name) it has to show 3rd page contents in 1st page. if i will go 3rd page, it has to show 1st page contents.
How to Handle this?
anybody any solutions. plz help me will be appriciated
regards
GV Ramana
|
|
|
|
|
hello I want to create controls from coordinates that I have in a data base, as for example a label with properties text, tag.
But that this label is created agreed the coordinates not nesecariamente must be rectangle can be a trapezoid.
thanks for its aid
Juanjo
|
|
|
|
|
Dim newTextBox As New TextBox
newTextBox.Location = New Point(x, y)
newTextBox.Size = New Size(sx, sy)
newTextBox.Text = someText
newTextBox.Tag = someTagValue
Me.Controls.Add(newTextBox)
This is the same way the Forms designer writes the code when you drop a TextBox (or whatever) on a form at design time.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|