|
Hi,
I wrote a UserControl in VB6, and i used PropertyPages to set the control's Property.
I want to wrtite this UserControl in VB.NET but i could not find how to make PropertyPages (or similar).
I also need to put a ProgressBar within a ListView column but i don't know how to make that.
Can someone help me please?
Thank you very much
Sindebad from France
|
|
|
|
|
I'm trying to write a program that will convert minutes to hours. For example, say a user inputs that they had 1,256 minutes logged on somewhere and they wanted to know how much that would be in hours (20.93 hours, but I need it to be displayed as 21 Hours and 55 Minutes.) Is there any built in method or function that .NET can use to calculate values on hourly or minutely fashion?
I've tried the dynamic help, but the time functions in there display dates and such.
I fear I may have to do it the old fashioned way with many mathimatical hijinx!
The Jazz Master 6000
DJ Badknees
Parma Grind Crew - www.geocities.com/parmagrindcrew
|
|
|
|
|
this may help :
VbCode:
<font color="blue">Private</font><font color="blue"></font> <font color="blue">Sub</font> Button1_Click(<font color="blue">ByVal</font> sender <font color="blue">As</font> System.Object,<font color="blue"></font> <font color="blue">ByVal</font> e <font color="blue">As</font> System.EventArgs) <font color="blue">Handles</font> Button1.Click <br> <font color="blue"></font><font color="blue"></font> <font color="#0000FF">Try</font> <br> <font color="blue"></font><font color="blue"></font> <font color="blue">Dim</font> x <font color="blue">As</font> DateTime = <font color="blue">New</font> DateTime() <br> <font color="blue"></font><font color="blue"></font> <font color="blue">Dim</font> mins <font color="blue">As</font> <font color="#0000FF">Double</font> = 120 <font color="DarkGreen">'/// minutes <br></font><br> <font color="blue"></font><font color="blue"></font> MessageBox.Show(x.AddMinutes(mins)) <font color="DarkGreen">'
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|
|
Hey!
Thanks a lot! This is just what I was looking for! Would I have to use the Format Function in able to just return a single value? Such as "2" being the number of hours? Or would I have to use some tricky string functions?
:-DCongradulations on the two girls!!!
The Jazz Master 6000
DJ Badknees
Parma Grind Crew - www.geocities.com/parmagrindcrew
|
|
|
|
|
Does VB (v6) have an equivalent to MFC's OnIdle? If not, is there a way for me to detect when my application is idle?
Dylan
|
|
|
|
|
Hi,,
I don't know how.. but maybe if you tell us what you want to do we can find an alternative.
|
|
|
|
|
Using VB.NET 2003, how do you access the name and path of the running application. I have found where you can use the command function (Microsoft.VisualBasic.Command()), but this returns a string of the arguments that are after the name of the application.
In C you can access this as the 1st element of the array of the command line arguments argv[0].
|
|
|
|
|
VbCode:
<font color="blue">Private</font><font color="blue"></font> <font color="blue">Sub</font> Button1_Click(<font color="blue">ByVal</font> sender <font color="blue">As</font> System.Object,<font color="blue"></font> <font color="blue">ByVal</font> e <font color="blue">As</font> System.EventArgs) <font color="blue">Handles</font> Button1.Click <br> <font color="blue"></font><font color="blue"></font> <font color="blue">Dim</font> sName <font color="blue">As</font> <font color="blue">String</font> = Application.ExecutablePath <br> <font color="blue"></font><font color="blue"></font> MessageBox.Show(sName) <font color="DarkGreen">'/// this will show the application's exe path and the application's .exe name. <br></font><br> <font color="blue">End</font><font color="blue"></font> <font color="blue">Sub</font> <br>
hope it helps
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|
|
I use VB6.0.
I would like to know if there is any API
to get UTC time out of local time.
Thanks
|
|
|
|
|
Hi..
from MSDN :
The GetSystemTimeAsFileTime function obtains the current system date and time. The information is in Coordinated Universal Time (UTC) format.
VOID GetSystemTimeAsFileTime(<br />
LPFILETIME lpSystemTimeAsFileTime
);
|
|
|
|
|
I am currently developing a system as a project for an university subject but is struggeling with something that is affecting everything in the system. I have an open form, where you enter information on a school / university. On the form you click on a button to register a contact person for that school / university. This button opens another form (the contact person form). After completing all the necessary contact's information and close the form, the contact person's name, surname and telephone must be showed in the previous form.
How on earth do you send the information from the contact form to the previous form (that is still open)?????
Can anybody help me?!? This is very important, for my whole project depends on this!!!
|
|
|
|
|
try this :
In Form1:
<font color="blue">Private</font><font color="blue"></font> <font color="blue">Sub</font> Button1_Click(<font color="blue">ByVal</font> sender <font color="blue">As</font> System.Object,<font color="blue"></font> <font color="blue">ByVal</font> e <font color="blue">As</font> System.EventArgs) <font color="blue">Handles</font> Button1.Click <br> <font color="blue"></font><font color="blue"></font> <font color="blue">Dim</font> frm2 <font color="blue">As</font> <font color="blue">New</font> Form2() <br> <font color="blue"></font><font color="blue"></font> Me.AddOwnedForm(frm2) <font color="DarkGreen">'/// add it as an owned form. <br></font><br> <font color="blue"></font><font color="blue"></font> frm2.Show() <font color="DarkGreen">'
In Form2:
<font color="blue">Private</font><font color="blue"></font> <font color="blue">Sub</font> Button1_Click(<font color="blue">ByVal</font> sender <font color="blue">As</font> System.Object,<font color="blue"></font> <font color="blue">ByVal</font> e <font color="blue">As</font> System.EventArgs) <font color="blue">Handles</font> Button1.Click <br> <font color="blue"></font><font color="blue"></font> <font color="blue">Dim</font> frm1 <font color="blue">As</font> Form1 = Me.Owner <br> <font color="blue"></font><font color="blue"></font> frm1.TextBox1.AppendText("some text from Form2 , to Form1!") <br> <font color="blue">End</font><font color="blue"></font> <font color="blue">Sub</font> <br>
hope it helps
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|
|
Thanx A LOT!!! I am going to try it! I knew the answer is easy, but you know how it goes - one always looks for the most difficult solution...
Good luck with the twins...
If I can't get it to work, you will hear from me again...
|
|
|
|
|
Hi
I would like to use a certain VB functions in Vc++.
It was recommended to me to make an ActiveX DLL in VB, and call VB ActiveX DLL in VC.
How can I make a VB ActiveX DLL?
Ehsan Behboudi
|
|
|
|
|
start a new project ..
choose ActiveX DLL
in the project add Class modules with functions , propertties you need..
then build the project.
is this all waht you need ?
|
|
|
|
|
So, I should make an ActiveX Dll project and add all the functions/constants to it, then build it?
how can I use the functions in my VC++ program.
should I just type the functions down in the VB, how can I add them?
Ehsan Behboudi
|
|
|
|
|
Hi,,
using it in VC++ is a long story
in brief look MSDN for CoCreateInstance
you can add functions , properties to the VB6 project :
choose Tools menu then Add Procedure
|
|
|
|
|
I am using multithreading in a program, but since I have never done so before I have some questions as to optimal use. Take the following example:
I have an COM object lets call it "comObj" which has a function "SendData". Since the program operates under heavy volume calling "Senddata" concurrently on seperate threads is desirable.
So now my question, if I call the same function on the same object in multiple threads will I really experience a performance gain? Or do I have to create multiple objects (created inside thread) to see a performace gain?
code:
[code]
'...in some function
Dim comObj as (whatever object)
'these are passed by reference
Dim mySend1 as new OutThread(comObj)
Dim mySend2 as New OutThread(comObj)
'...destroy objects...
Public MustInherit Class ThreadWrap
' i use a threadwrapper because multiple thread subtypes
Protected m_Thread As Thread
Public Sub New()
m_Thread = New Thread(AddressOf run)
End Sub
Public Sub start()
Me.m_Thread.Start()
End Sub
Public MustOverride Sub run()
End Class
Public Class OutThread
Inherits ThreadWrap
dim m_objCom as object
Public Sub New(ByRef comObj As Object)
m_Thread = New Thread(AddressOf run)
m_objCom = comObj
End Sub
Public Overrides Sub run()
'this is the sameobject used in both threads
m_comObj.SendData
End Sub
End Class
[/code]
Now the alternitive I see would be to not delcare your object first and then create and destroy it inside the Run() function, but that would require twice as many calls to the constructor and destructor, plus of course more overall memory.
So logically I would hope the method above does utilize multiple threads, but do all threads have to wait on that one object and does that create a bottle neck? Any clarification would be great thanks.
~rlcc
|
|
|
|
|
Multiple threads will generally give you gains over single thread on these situations:
1. More responsive UI;
2. There's something the CPU could be doing while it's waiting for an I/O operation;
3. You have multiple CPUs;
4. You have a Pentium 4 with HyperThreading, on some specific situations;
Notice that you won't have CPU gains, actually, as you've noticed, you will spend more CPU to do real parallel work; so, the general rule is only to MT if your CPU is waiting for something.
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
Hi
How can i get the width of a col in a datagrid?
|
|
|
|
|
how to get sounds effects to my programin VB6
example : when i press a button a song plays and so on
BUT without running its program(winamp,windows media player,...etc)
please reply to me
ahmed
ahmed elmahdy
|
|
|
|
|
Use the sndPlaySound[^] API.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Do you know how to create outlook style interface ? Thanks.
Frances
|
|
|
|
|
Easy. Just combine several pannels and splitters and use the docking property.
|
|
|
|
|
i am trying to get the number of files returned when you use the getfiles function so i dont have to run through them first. the getlegth part accepts a parameter called dimension which is a zero based array but i dont know what to give it any help would be much appreciated
|
|
|
|