|
eyes2007 wrote: public sub new()
private _c2 as new c1
end sub
'some code
You can't declare something as private when it's declared within a method ( which is what your constructor is ). You have to declare it outside the constructor for it to be a member, and for private/public to have meaning.
eyes2007 wrote: the main class is a control, and the sub class is another control that i m trying to place on the main class's control
This is a bad design. Place one control inside another, sure, but it makes no sense to declare them that way
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 make a program with Winsock control, and its running on my pc. But this program can't run on aother pc, with this message: "Component 'MSWINSCK.OCX' or one of its dependencies not correctly registered: a file is missing or invalid."
How to make any computer can run this program???
thanks,
[i'm beginner]
|
|
|
|
|
Seems likely that you need to install and register mswinsck.ocx
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 )
|
|
|
|
|
hello
please help me how to set a combo box readonly so user couldnot write into combbox.
thanks.
|
|
|
|
|
I believe there's a property for the style of box, and one of those is dropdownlist, that means it's a list only, no typing allowed.
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 )
|
|
|
|
|
Hi dear i think here is your answer
http://www.codeproject.com/cs/miscctrl/ReadOnlyComboBox.asp
Salman Sheikh
|
|
|
|
|
I'm now developing a small antivirus as my personal tool to wipe out viruses. I then wanna have it to scan automatically the files and folders that Windows or users use, as it is in Norton AV (Enable Auto Protect), McAfee (On-Access Scan) and so on. But I can't find any code to do that. Can anyone help me on this?
Everything has its start. So, start something today; then you will be a step forward.
-- modified at 22:07 Tuesday 14th August, 2007
|
|
|
|
|
Do you honestly expect that a small program you write is going to do better than programs like AVG ? Even if you were not using VB6, I'd still doubt that.
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 never expect my small program to be better than the professional AV. But I just wanna do something for myself, improve my knowledge for depth VB programming. In the other words, I do it for my personal use or others if they need, and for FUN programming.
Can you help me then? I just want a piece of code that get FILENAME or FOLDER NAME that windows is accessing.
|
|
|
|
|
You can't do it in VB6 code. You have to write a piece of code that hooks the file I/O API, using a technique called "DLL Code Injection". This code has to be written in C++ to support the exports required by the technique. You'll be interacting with the O/S at the kernel level, so I sure hope you know what you're doing.
|
|
|
|
|
Hello all,
I was given a control library and need to add it as a reference to my project. It was created as a dll using the .NET framework (which is the same one I am working with) but visual studio will not let me add it as a reference. I get the error message "not a valid assembly or COM component." I know this library works because I have seen it in action but I'm having no luck.
Sorry this is so vague but any ideas?
|
|
|
|
|
You can only add a reference to a .NET Managed-code DLL or a COM-based .DLL. Library DLL's don't get a reference. You have to P/Invoke the functions in these DLL's.
The other thing that may be stopping you is if the .DLL is forced to use a different version of the .NET Framework than 2.0. You cannot load two different versions of the .NET CLR into the same process.
|
|
|
|
|
This was, as I suspected, just bad code, and that was recognized by another pair of eyes. The problem in finding it, is that at run time it is legitimate code, just not what I intended. The call to 'GetDefaultFileExtensions' should not have had an argument. tg
'****************************************
I know that I get pretty dumb late in the day, so I hope someone can just point out the source my stupidity.
Below is partial code from a class. I'm accessing the 2 properties and getting truncated results for both. For discussion's sake I'll just describe 1 of them - 'DefaultFileExtension'. This property's ReadOnly method calls the 'GetDefaultFileExtensions' function which should return the value of a constant, which in this case is "*.pdf". Look at the 2 'MsgBox' items in the code. I put them there for debugging. The message box inside of the 'GetDefaultFileExtensions' function displays "*.pdf". The message box in the 'DefaultFileExtension. property get displays "*" as the returned value from 'GetDefaultFileExtensions'.
I've tried replacing the sReturn variable with the literal "*.pdf" and still get the same result. Also recompiled, and even rebooted.
I'm stumped and open to suggestions.
Thanks, Tom
'******************************************
Friend Class clsFileDefinitionStructure
Friend Enum fdFileType
PDF_ft
Image_ft
End Enum
Private Const mc_DefaultFiletypeDescription_PDF As String = "PDF files"
Private Const mc_DefaultFiletypeDescription_Image As String = "Image files"
Private Const mc_DefaultFileExtension_PDF As String = "*.pdf"
Private Const mc_DefaultFileExtension_Image As String = "*.gif;*.bmp;*.jpg;*.jpeg;*.tif;*.png;*.pcd;*.pcx"
Private m_FileType As fdFileType = fdFileType.PDF_ft
Friend ReadOnly Property DefaultFileExtension() As String
Get
MsgBox(GetDefaultFileExtensions(m_FileType))
Return GetDefaultFileExtensions(m_FileType)
End Get
End Property
Friend ReadOnly Property DefaultFileTypeDescription() As String
Get
Return GetDefaultFileTypeDescription(m_FileType)
End Get
End Property
Private Function GetDefaultFileExtensions() As String
Dim sReturn As String
Select Case m_FileType
Case fdFileType.Image_ft
sReturn = mc_DefaultFileExtension_Image
Case fdFileType.PDF_ft
sReturn = mc_DefaultFileExtension_PDF
Case Else
sReturn = "*.*"
End Select
MsgBox(sReturn)
Return sReturn
End Function
Private Function GetDefaultFileTypeDescription() As String
Dim sReturn As String
Select Case m_FileType
Case fdFileType.Image_ft
sReturn = mc_DefaultFiletypeDescription_Image
Case fdFileType.PDF_ft
sReturn = mc_DefaultFiletypeDescription_PDF
Case Else
sReturn = "All Files"
End Select
Return sReturn
End Function
End Class
-- modified at 9:14 Wednesday 15th August, 2007
Tom Garth
Developer
R. L. Nelson and Associates, Inc., Virginia
|
|
|
|
|
I have no idea why this is happening. The code doesn't show anything that would cause it.
I'd remove the MsgBox lines and just step through the code, line-by-line, using the debugger and watch the variables involved.
|
|
|
|
|
Hi Dave,
I had already used the debugger while working line by line. I added the message boxes to make it easier to try different variations.
The only thing the code shows is that I stupidly added the FileType Enum as an argument to a call that didn't ask for an argument. The result was explained to me by in a very elegant answer from Armin Zingler at:
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.dotnet.languages.vb&mid=03cf9ea6-b81a-48fe-ad43-f1f48517dbdc[^]
I've copied his explanation here:
************************************************************
This is awesome... The thing is that
GetDefaultFileExtensions(m_FileType)
is short for
GetDefaultFileExtensions.Chars(m_FileType)
because Chars is the default property of a String, and because
GetDefaultFileExtensions does /not/ have arguments. As m_FileType is 0, this
is actually
GetDefaultFileExtensions.Chars(0)
So, you get the first char of the string, which is "*" only.
Armin
************************************************************
Cool huh?
Tom Garth
Developer
R. L. Nelson and Associates, Inc., Virginia
|
|
|
|
|
Oh my God! I was poking through that code for an hour and didn't see it! :->
|
|
|
|
|
Hello friends of the Forum
I go to their valuable help with the following problem
It is possible from net to automate Directory Activates.
Concretely I want to activate the directive one that this in
Configuration of User
Administrative insoles
System
And to enable the directive one
Alone to Execute applications of allowed windows
And to establish the list of programs EXE that the user can execute, I can them
to select of a list.
Example: winword.exe, excel.exe, etc.
My idea is that the user can make it from ASP.net
I wait their valuable help, and thank you for their time
|
|
|
|
|
I need some help getting a icon for my vb.net program. I don't want to use the default icon shown in the application's project properties. Any ideas on how to change the icon for a vb.net program and where to get the icons from?
jds1207
|
|
|
|
|
If you have an icon in your project, you can double click on it and Visual Studio will open an icon editor so you can make your own. Or you can search on-line to purchase or find some free icons to download. Simply include the icon you want in your project. Then go to your application's properties and select the icon. If you want the icon to appear on the upper left corner of the form, you have to select the form and change it's icon property to the icon of your choice.
Hope this helps.
|
|
|
|
|
Hello,
I want to code something similar to tabcontrols but different enough to warrent a new control.
I have simplified my issue:
I want a user control to which I can add multiple pages (panels) of windows form controls
in design time , then use those pages in runtime. Also in design time I want to navigate between the panes.
I guess my user control needs to have a designer based on System.Windows.Forms.Design.ParentControlDesigner created but...
I was wondering if anyone of you people can recommend a good guide/article/ even a book to designtime coding using vs2005
any tips/advice ? (not rude please!!)
most of the articles I have google'd were either vs2003, c# or just plain awfull. The msdn2 articles I have read where barely understandable.
any help would be appreciated
(lost , confused , alone - stuck in design time - sigh)
thanks
Martin
life is a bowl of cherries
go on take a byte
|
|
|
|
|
I personally hate Design time programming! There is a great book on custom controls called: "Pro .Net 2.0 Windows Forms and custom controls in C#" by Matthew MacDonald. Publisher: Apress. I think there is a VB.NET version. Just as a tip (that you might not like): You will find a lot more help with intense topics like this if you are programming in C#. I used to be a diehard (beginning) programmer and I hated C# when I first started using it. Now I wouldn't go back to VB.Net for anything. (million dollars maybe)
Hope it helps!
Richard
|
|
|
|
|
hi,
thanks for that
c# seems to be the next comming thing but argh I find it cumbersome to read!!
I have programmed in Delphi, RPG , C++ , VBA , VB etc but c# just seems - ugh!
cant place why though - maybe its too much like javascript - maybe I dont like braces!! (tell me why! I dont like mon.... er sorry cant get that tune out my head)
I will probably trickle into it eventully.
Of course it doesnt help if your company is currently a VB shop - anyhoo...
you havent seen any good online articles have you??
thanks
martin
life is a bowl of cherries
go on take a byte
|
|
|
|
|
Is there a way to find the task bar Y location? I want a window to come up right above the task bar. Some people like myself raise the task bar up to be able to see the many programs that I have open.
|
|
|
|
|
if you only have on screen then you can compare primaryscreen.bounds.y with primaryscreen.workingarea.y . The bounds will give you the whole screen resolution and the working area will give you that minus taskbar. Make sure that you take into account that the taskbar can be on any side of the screen.
|
|
|
|
|
When a user clicks a button on a form it calls a function in a module. The function is very math intensive and may take 5 minutes or more to run. The user may not want to wait that long so I want to have a cancel button on the form that would terminate the function. How can that be done?
|
|
|
|