|
I have a 2 labels and a check box..
I want if I click on checkbox change a setting, and for that 2 labels too ,if I click on them that setting maust change...it means the code of check and labels are the same
so how can I write one code for them 3..
(i have recive a reply "please help me " ..good but not complete)
help me Please again
|
|
|
|
|
Yes. The reply you got before was complete! If there is something missing, it's because the requirements you gave us are not complete.
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click, Label2.Click
If CheckBox1.Checked = True Then
CheckBox1.Checked = False
Else
CheckBox1.Checked = True
End If
End Sub
Note: You don't need code for the CheckBox itself to change it's state. The CheckBox will automatically handle that itself.
UPDATE:
I see from you other post that your looking to put code in the CheckChanged event of the CheckBox. You didn't mention what you wanted to put in your event handler, so, adding to the code above...
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
MsgBox("Check Changed!")
End Sub
And, no, it's NOT a good idea for one function to handle both the Label Click's and the Check Changed events. Clicking on the Labels will generate a Click event, which will call the Click handler above. If you change the status of the CheckBox, it will generate a CheckChanged event and will call your Click handler AGAIN.
RageInTheMachine9532
|
|
|
|
|
Tanx
nice solution
i can't remember that what did i do that mades overflow error
|
|
|
|
|
check back to my other post, it is the solution to your problem. it handles the event for all 3 objects.
------------------------
Jordan.
III
|
|
|
|
|
|
let me know how it goes.
the sub procedure i wrote in reply to my 1st original post will do what you want. it handles the 3 objects' click event, chaning the state of chk box. then right the code in the chkbox's checkedchanged method
------------------------
Jordan.
III
|
|
|
|
|
Hi.
I recently installed VB .NET 2003. It seems a lot more complex then VB6, which it is :P.
I was wondering if you can get DriveList, DirList and FileList boxes.
Also, I need to know if you can somehow DISABLE the use of all the .NET framework languages when compiling, because my basic app doesn't use it, and I want it to work on all PCs.
I really need to know these two answers.
Thanks in advance,
Kane~
|
|
|
|
|
Kane~ wrote:
I was wondering if you can get DriveList, DirList and FileList boxes.
Those control are deprecated, but still available in a backward compatibility namespace call VB6, go figure. It's recommended that you do NOT use them because there is no guarantee that they will still exist in the next versions of VS and the Framework.
To get to the controls, click on the "My User Controls" tab. Then, righ- click in the toolbox and pick "Add/Remove Items...". Scroll down the list of .NET Framework Components and check DirListBox, DriveListBox, and FileListBox. Don't check the Array version of these! Then click OK. You can now use these components just like before in VB6.
Kane~ wrote:
Also, I need to know if you can somehow DISABLE the use of all the .NET framework languages when compiling, because my basic app doesn't use it, and I want it to work on all PCs.
If you're writing in C#, J#, VB.NET, C++ with Managed Extensions, you MUST use the Framework. There is no such thing as not using it in VB.NET, or any of the others. So, no you can't turn it off. Any app that you write in VB.NET will only run on machines that have the .NET Framework installed.
RageInTheMachine9532
|
|
|
|
|
I have written a program that disconnects a Demand-Dial connection every so often, based on a timer. This has worked before, but after REinstalling Windows 2003 Server, it will not retrieve a handle of the server from any remote computers. It is written in VB.NET and i dont know what happened to stop its functionality. No developing operating systems have been changed.
The main calls are:
-MprAdminIsServiceRunning - which comes back false if I specify the server name, or if I use the keyword "Nothing" and execute it on the server, it comes back true.
-MprAdminServerConnect - which has the same behaviour as above.
More Below:
Private Declare Function MprAdminIsServiceRunning Lib "mprapi.dll" (ByVal lpwsServerName As String) As Boolean
Private Declare Function MprAdminServerConnect Lib "mprapi.dll" (ByVal lpwsServerName As String, ByRef phMprServer As UIntPtr) As Long
Thankyou for any help on this.
MASOSi
|
|
|
|
|
Finally Found It!
In the declarations above, the keyword 'Unicode' was missing after 'Declare'.
e.g. Private Declare Unicode Function MprAdminIsServiceRunning...
This may come in handy for someone one day.
MASOSi
Its amazing what you try when you're desparate.
Its amazing what you try when you're desparate.
|
|
|
|
|
Guys, I have a question and I'm not sure this can be done in VB6.
I have a VB6 ActiveX DLL project which contains a module where I declare all the public constants I require.
The thing is, I need to access the public constants from another project (a VB6 Standard EXE) that referenced it.
I found that public constants in the module are only accessible from within the project and I cannot move the public constants into a class as it is not allowed.
I am thinking of changing them into public variables or static inside a class and set the variables on the initialization of the class. Is this a good thing to do or does anyone have a better idea?
Thanks for the help,
Edbert P.
Sydney, Australia.
|
|
|
|
|
If I read your description right, all your constants are declared in a .bas module, right?
If you need to use them in another project, why not just add the existing .bas file to your new project? If you have to, strip any code out to a seperate .bas file. The idea being that you keep a library of constants, structures, and .DLL declarations in one file, everything being public and not in a class, so you can use them anywhere.
I used to keep a .bas module file just for Novell Client constants and .DLL function declarations. Any apps that I wrote that depended on even a few of these constants and functions, and there were a bunch of them!, included the same Novell.bas module file.
RageInTheMachine9532
|
|
|
|
|
I was hoping that there's another way and that I have forgotten VB6's tricks of the trades among all these .NET mumbo jumbo.
Thanks for the information
Edbert P.
Sydney, Australia.
|
|
|
|
|
Constants are constants... It really doesn't matter.
You could also keep them in a class file, between a namespace definition and a class definition. This way, you could keep the constants in a namespace and they would still be usable without creating an object from the class.
It's just a matter of preference...
RageInTheMachine9532
|
|
|
|
|
AFAIK, the constants cannot be stored in TLB (Type Library), but it's possible to use the Public Enum instead.
With best wishes,
Vita
|
|
|
|
|
Hi All
while selecting the components from in the visual basic 6.0 version i m getting error "System error &H80004002 (-2147467262) No such interface supported...."
I have already gone through the following link "http://support.microsoft.com/default.aspx?scid=kb;EN-US;180071" but i didnt get any thing .... my machine is NT 4.0
"Sometimes the love we are looking for its just right in front of us - too close for the eyes to see. So close your eyes & let your heart see for itself."
|
|
|
|
|
Details! Details! Just supplying us with an error message isn't useful. We need to know if this happens for ANY component you try to add, or just a couple? What components are you picking? Are they ActiveX .DLL's?
The above article link you supplied goes to an article about VB5 runtime files. Is this what you intended? I found this[^] article a bit more helpful. If this is the one you went through, did you get any error messages?
Did you try reinstalling Service Pack 6a for NT4 and SP5 for Visual Studio 6?
RageInTheMachine9532
|
|
|
|
|
Hi thanx for the reply..
well frankely speaking i m new into this line...actually i will tell u exactly what happened...... i had downloaded one application from the net and after and while uninstalling that application when i opened the visual basic (6.0) for new project ..........while doing that i just went through the project->components....... i find out the system error message.............. and the other important thing i find out there is .....that there is no components over there..not even a single one............than i type the same error into search group and find out the url of microsoft which i have given in my first query........
i download the particular exe and run that also but still the problem is same............... i can't do anything on my previous projects where i used some components
while running the VB5 file i didnt get any message
my machine is NT 4.0 and visual basic version is 6.0 Enterprise Edition
One more important thing is that i have uninstall the visual basic then, while doing installation of that if i select the Active X components option it was not installing the visual basic successfully also.......but without going for the option of active x components it is installing the visual basic successfully
|
|
|
|
|
Vipin Bokariya wrote:
and after and while uninstalling that application when i opened the visual basic (6.0) for new project
Are you saying that you opened VB6 WHILE the uninstall was going on? If so, this was a bad idea...
When you reinstalled VB6 and then reinstalled it with the ActiveX components selected, what was the error message, exactly?
It looks like your going to have to uninstall and reinstall VB6 again so have your CD's handy. Your also going to have to reinstall SP5 for Visual Studio 6 and SP6a for NT. Have those handy as well.
RageInTheMachine9532
|
|
|
|
|
First My question.
I want to know how i can send messages between computers, a message would used to trigger an event (or send a text message) to the other computer.
How can I send information between 6 computers?
thank you!
-Marvin Guerrero
Then Why I asked!
I am developing a monitoring system. It will be used to monitor surveys and the like such as election results.
Votes Monitoring.
phone calls will be made by agents located at precincts to a call center, a call will include information such as the precinctNO and the number of votes. The information will be encoded into a computer wich belongs to a network, any information saved in an ACCESS database through encoding must reflect on another computer that shows graphs.
The call center will house 6 computers and will operate in a network environment, 5 will serve as data entry(encoding) units and last(Monitor) computer will be used to montior the inputs from the five computers.
The Monitor computer must be able to capture the data as they are saved or in other words display data in real time. I can do this by adding a timer control the refreshes the connection of the Monitor Computer, However.. that would mean that the connection is refreshed even though there is no new data, and that would be inefficient.
I want to apply a method wherein the 5 computers will wend a message to the Monitor PC and only then will the connection be refreshed.
But I don't know how to do that. Its like a chat application.
Marvin N. Guerrero
Hexaven Algo-rythm
|
|
|
|
|
Guerven wrote:
Its like a chat application
Yup. Start there, look for samples of chat applications that already include the basic features of socket communications that you need (here on CP or through Google). On top of such a framework, you might need to consider connection pooling... although in your case, with a known number of clients, you could be safe using a static number of connections and set port #'s to connect to from the clients. If the samples you find don't include or address asynchronous callbacks and threading, look for other samples.
On the other hand, this could be something that is solved using MSMQ/MTS, or whatever that's called now.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Access wasn't designed to be the back-end for anything with multiple users/connections. I would HIGHLY suggest using either MSDE or a full SQL server for that.
RageInTheMachine9532
|
|
|
|
|
I have a check box and a button and a lable that I want they do one thing.
how can i write only one code for them..
for example i want if i click on lable the check box set to true and next time set to false..exactly such as when i click check box..
please help me..
|
|
|
|
|
if you want a click event to occur on more than one object, and it to perform the same code for each event, you must include an array handle. the following is a sample of how to have a click event for a checkbox,button, and label all do the same thing; change the state of the checkbox.
<code> Private Sub MyHugeEvent(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click, Label1.Click
If CheckBox1.Checked = True Then
CheckBox1.Checked = False
Else
CheckBox1.Checked = True
End If
End Sub</code> note the end of the sub declaration line, after handles ("Handles Button1.click, label1.click") you can add more events for objects here for this code to be called once that event occurs.
edit: notice you dont have to include any event handler for the actual checkbox.checkedchange (or click) methods
------------------------
Jordan.
III
|
|
|
|
|
Thanx Jordan
But if i want to have some code in checkbox_chackedchange ...what should I do?
for example..
I have a 2 labels and a check box..
I want if Iclick on checkbox a change a setting, and for that 2 labels too if I click on them that setting get changed...it means the code of chck and labels are the same
help me Please again
|
|
|
|