|
|
I don't mind helping cross-dressers, as long as it's only with their programming...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
yeah, but I'm a girl. They're always stealing my make-up!
Blog link to be reinstated at a later date.
|
|
|
|
|
Buy a book, take a course, you can't just get source like this for free, that's why people pay for it.
Christian Graus
Driven to the arms of OSX by Vista.
"Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.
|
|
|
|
|
Christian Graus wrote: Buy a book, take a course
Perhaps a couple of both. Programming books, books on the basics of accounting, and courses in both programming and accounting. At least the OP will then have some foggiest idea what to do.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Can any one help me, regarding resizing and positioning a control at run time.
|
|
|
|
|
How about something like this:
Object.Width = 50
Object.Left = 150
If you want something more specific, you are going to have to ask a more specific question. Give us a code sample. Tell us what you want to have happen.
|
|
|
|
|
Hi, in the Visual Studio Debug View value column (same as the debug mode hover pop up tooltip) I find it inefficient that for variables of compound types only the type name is displayed and to get to any state information I need to expand the display (click on plus icon). I found an example image here:
http://www.davidhayden.com/photos/defaultdebuggervisualizer.jpg
I'd love to control what goes into the string currently displaying the type name, like a function or property that, if implemented, overrides the default debugger class type display. I.e. in the image above I'd want to replace the "{Ecommerce.Shoppingcart}" with the output of Ecommerce.Shoppingcart.ToString().
Any idea if and how this is possible?
Thanks,
Ingmar
modified on Monday, November 10, 2008 3:00 PM
|
|
|
|
|
Couldn't you do items(0).tostring in the watch window?
Or you could override the .tostring and loop the items with a debug.writeline with how you want the data formated.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
> Couldn't you do items(0).tostring in the watch window?
> Or [...] override the .tostring and loop the items with a debug.writeline [...]
Of course I could, but that is equally inefficient, i.e. I need to do stuff to get to the state information.
What I want is to sit down once (per custom type), write a useful concise state to string conversion, and then have it be used automatically by Visual Studio whenever the matching variables are in a debug view.
|
|
|
|
|
|
Thanks Scott, this gets pretty close.
However, C# and VB seem to behave differently. The documentation talks by default about the C# solution and how ToString() can be used to fill the debugger value field. That is exactly what I wanted. But in Visual Studio 2005 and VB.NET ToString() is by default a function, and unfortunately < DebuggerDisplay("{ToString}") > is rejected. Only if I use a property does it work, so I have to make a DbgStr() property that calls ToString(), a little ugly but works.
|
|
|
|
|
Unless your ToString method contains complex logic and formatting rules, you could specify it directly in the attribute as <DebuggerDisplay("ProperyOne = {PropertyOne}, PropertyTwo = {PropertyTwo}")> . Also, try specifying it like this: <DebuggerDisplay("{ToString()}")> .
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
You will want to look into adding custom AutoExpand rules. A search for AutoExp.dat should get you the info you need.
Note: On my system, AutoExp.data is located here:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Packages\Debugger
|
|
|
|
|
Hello guys!
I´m using the Dir$() function, that returns the paths of the files that I want.
I noticed that the sequence is always the same. I need a reverse function just like a navigation through image files, backward and foward. Does anyone have an idea?
Thanks!
|
|
|
|
|
No, there is no "sorting" like that going on. The order of files you get is not guaranteed, but tends to follow the order as they come from NTFS.
There is no function that will return them in backwards order. Get the list of files from NTFS, including the creation date/time and sort the list on that.
|
|
|
|
|
Hi,
I know that you can use extension methods in C# while targeting version 2.0 of the .NET framework by creating your own System.Runtime.CompilerServices.ExtensionAttribute
I've done the same in a VB.NET application but for the life of me I can't get the thing to work. Here is the code I'm using:
Namespace System.Runtime.CompilerServices
<attributeusage(attributetargets.method> _
Public NotInheritable Class ExtensionAttribute
Inherits Attribute
End Class
End Namespace
In a module
Imports System.Runtime.CompilerServices
<extension()> _
Module ExtensionMethods
<extension()> _
Public Function Test(ByVal s As String) As String
Return s & " hello"
End Function
End Module
Sub Main()
Dim s As String = "Hello"
Debug.Print(s.Test())
End Sub
I get a compiler error saying that "Test is not a member of String"
Am I missing something or can you simply not use extension methods in VB.NET for version 2.0?
Thanks very much,
dlarkin77
|
|
|
|
|
If I remember correctly, extension methods cannot be targeted for version 2 (for example extension attribute was introduced in 3.5). Have a look at this article: Extension Methods (Visual Basic)[^].
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
It seems I was being particularly dense yesterday afternoon. The reason I couldn't get this to work was that I was actually using VS 2005 instead of VS 2008.
The above code snippets work correctly when targeting .NET 2.0 in a VS 2008 project
Thanks,
dlarkin77
|
|
|
|
|
Does anyone know how to get it put into a web page i made it it works when i run it using VB6.0 it opens an IE windows and performs exactly as desired its a standalone so its not that hard i just dont know how to put it on the web for people to use any information would be great a link to anothe rsite on activeX components
the program is simple only a couple lines of code does not need to connect ao server of any kind just need help getting it onto a web page thank you for your time
|
|
|
|
|
I think you want to look into the OBJECT tag. Here...[^]
|
|
|
|
|
Hi,
I don't know if it is a good practice what I am doing here.
I have a class that is making the connections to the database. The connection string I save in the web.config.
And this is the property that I used inside that class to get the connectionstring.
Does it make sense?
''' <summary>
''' This variable holds the db connection string.
''' The value of the db connection string is saved in the web.config.
''' </summary>
Private Shared sConString As String = System.Configuration.ConfigurationManager.ConnectionStrings.Item("ConnectionString").ConnectionString
Private Shared ReadOnly Property ConString() As String
Get
Return sConString
End Get
End Property
|
|
|
|
|
Making the property private is pointless as the only thing that access to the property also has access to the original string. Other than that, looks okay.
|
|
|
|
|
So, it is better that I use only
Private Shared sConString As String = System.Configuration.ConfigurationManager.ConnectionStrings.Item("ConnectionString").ConnectionString
Isn't that so that every time I ask for sConString, he will lookup the connection string in the web.config?
Or I can do the following ?
Private Shared sConString As String = ""
Public Sub New()
sConString = System.Configuration.ConfigurationManager.ConnectionStrings.Item("ConnectionString").ConnectionString
End Sub
|
|
|
|
|
ESTAN wrote: Isn't that so that every time I ask for sConString, he will lookup the connection string in the web.config?
No. It won't. Think about what you are actually doing. You have a shared field on the class. It has no functionality, it is just a reference to an area of memory that stored the connection string.
ESTAN wrote: Or I can do the following ?
Private Shared sConString As String = ""
Public Sub New()
sConString = System.Configuration.ConfigurationManager.ConnectionStrings.Item("ConnectionString").ConnectionString
End Sub
You can, but I don't see the point.
|
|
|
|