|
UltraCoder wrote: 2. I have tried everything but a Marquee progress bar does not work. It justs sits there. The code I'm using is:
The Marquee style only works on Windows XP and above and only if you have EnableVisualStyles turned on in your application. It won't work at all on Window 2000 and below.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hey,
Is there a way to keep a form from closing? Example, if someone clicks on the close button in my program, I want the program to show a message box asking if they really want to close the program (I've got that), and then if they click no, then I want the program to stay open.
Is there a way to do this, I've seen it in other programs but I can't figure it out.
Please help! Thank you.
|
|
|
|
|
Check out the Form.Closing[^] event, complete with a sample of what you want to do.
Are you really sure you're an "Ultra" coder?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
I need some help with this piece of code bellow.
I'm extracting pieces of information from Excel throug the following ADO connection.
This is a piece of VBA code implemented inside Access.
[code]Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Set con = New ADODB.Connection
With con
.CursorLocation = adUseClient
.Mode = adModeRead
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=E:\ExcelFileTool.xls" & _
";Extended Properties=""Excel 8.0;HDR=Yes"""
.Open
End With
Set rs = con.Execute("SELECT Site FROM [Clients$] WHERE Site = 'SiteOne'")
Debug.Print rs.Fields(0)
rs.Close
Set rs = Nothing
con.Close
Set con = Nothing [/code]
This code is part of an Access Module and it's inside a loop process. The problem it's related with Excel processes are kept open in the memory.
I'll try to explain the best I can, and sorry about my bad english.
If I run this piece of code without the Excel file opened, everything runs Ok.
But when I run the code with the Excel file in question opened (and I need it opened for other reasons), every loop will increase the Excel process memory about 250KB plus (I see it in TaskManager), and there's more.
When the loop ended, even closing the opened Excel, the Excel Process keeps open on the TaskManager.
The 250KB increasing is very problematic because this macro will run thounsands of loops per day.
Thanks
P&V
|
|
|
|
|
I have a vb2005 logon.aspx page and i have on that page i have the standered System.web.UI.WeControls.login. what im trying to find out is how to dynamicly poition the control in the centre of the page
I really do need help..... all this computer stuff is way over my head !!
|
|
|
|
|
Hi, using VB net(2003) I have 2 questions. First how to change dynamically the property of textAlign in a textBox, see my ex: property of textAlign in the textBox1 is already set to the right, what I would like to do is when I change the value in that txtBox would be that data move to left, and after I finish then hit tab button on keyboard data move back to the right. My second question is how to set a value like zero 0 as a default in that same textBox only when that textBox is empty. Thank you in advance for your help.
|
|
|
|
|
You just need to capture the events: Enter and Leave
This code might help you:
<br />
Private Sub TextBox1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Enter<br />
Me.TextBox1.TextAlign = HorizontalAlignment.Left<br />
End Sub<br />
<br />
Private Sub TextBox1_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Leave<br />
Me.TextBox1.TextAlign = HorizontalAlignment.Right<br />
End Sub<br />
If you are using this code many times, you might wanna implement this code in your custom textbox, so you wont have to repeat this code for every textbox you have in your form.
-- modified at 16:54 Friday 27th October, 2006
Dave Kreskowiak (Below) is very right, For your second question, capturing the TextChanged Event would fire the same event again.
If you explain a little bit more about what you are trying to do, maybe someone could give you the best way of doing it.
Alexei Rodriguez
|
|
|
|
|
you can use this:
Private Sub Textbox1_TextChanged(byval .....)
if Textbox1.Text = "" then
Textbox1.Text = "1"
End if
Regard,
Adrian
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
That won't work because it will continuously fire the TextChanged event. If you change the Text property in the TextChanged event handler, you have to take precautions to tell that your in the handler a second time.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Is there a way to print a form to a printer at runtime?
|
|
|
|
|
A little search on MSDN for "printing a form" reveals this[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
I have access to a program, in which all of the text editing is done through table fields.
However the Delete key doesnt delete text. Only the backspace key will delete text.
Also, Ctrl-C/CtrlV is spotty at best.
Any ideas as to what might cause this?
|
|
|
|
|
Is this an app you wrote or you're using??
You question sounds like it's one you're using, in which case the answer would be because the developer didn't add support for the Delete key, or removed it, depending on the control he/she used.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
It's an application I'm using, but I have access to the source code, so I can change it if I need to.
From the looks of it, the controls used are PropertyGrids and DataGrids.
|
|
|
|
|
Hi,
I'm fairly new to vb.net and I'm trying to declare a class that is a collection of another class.
I believe this is possible in c# using syntax like the following
public class myList : List<myItems>
I'd be very grateful if any one can tell me the answer, even if it is that you can't do it in VB.
It makes the code a lot easier if you can refer to the list within the class as "me."
, also I'd like to be able to refer to some of the data types I've declared in myItems within myList
Thanks
Sean
|
|
|
|
|
Public Class myList : Inherits List(of myItems)
Keep in mind the only thing you can now add to the collection is objects that are of type myItems.
Mike Lasseter
|
|
|
|
|
Thanks Mike,
greatly appreciated.
I'd tried inherits and : but not both together !
Sean
Sean
|
|
|
|
|
A colon is just a statement seperator. It has nothing to do with declaring a class or inheritance. You can do the exact same thing like this:
Public Class myList
Inherits List(Of myItems)
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i'm a new member here and was wondering if y'all can help me with this project i'm about to start? i want to write a program that will track phone call durations on a landline using either visual basic.net or VB6. i want to ask if this is possible and how to go about things.
thanks everybody.
kofiwusu
|
|
|
|
|
On a land line? This isn't Voice over IP. VOIP is a phone call made over an IP network.
If you're talking about a land line, how is the machine going to know that the phone was even picked up? Or are you talking about some other hardware setup?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thank you very much, i guess i didnt know the difference. i'm talking about the land line. i'm talking about how the machine is going to know about when the phone is up, duration and very thing. let me tell you what i really want to do:
I'm a student at the catholic university in Ghana, west africa, i want to use either visual basic 6 or .net to write a program for my project work. i want to write a program on monitoring phone calls (landline) using a pc. i'm thinking the program should be able to recognize the number been dailed, duration of the call so that i can use it to calculate the cost, also record incoming calls. i have done visual basic 6 and .net not into details but i hav no idea on how to start this project. anyway u can help me i'll be very grateful.
|
|
|
|
|
vb.net
how do i remove an event handler from a control, when i don't know, which one is currently connected to this control?
depending on the situation, i want to add different handlers to a button, and before adding a new one, i have to remove the old one.
|
|
|
|
|
The only way to do this is to take control of all event handlers yourself.
1. Remove all the Handles clauses that the designer puts in.
2. Explicitly define all your handlers using AddHandler.
3. Before adding new handlers always use RemoveHandler to remove all the handlers.
(It does not matter if the handlers are not added when you call remove)
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|