|
textboxes don't use timers, all they use is some real estate on some form.
you can tell what code should get executed when a particular timer event fires, so tell the one you choose to update the GUI and show current time. You'd better use a System.Windows.Forms.Timer for that, as that one ticks on the GUI thread!
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
modified on Thursday, February 18, 2010 6:40 PM
|
|
|
|
|
Hello Luc
this is what i tryed
and it did not work
can you help me please
Thanks
Bob
Public Class Form1
Private Shared The_Time_Is As New System.Windows.Forms.Timer()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
The_Time_Is.Enabled = True
The_Time_Is.Interval = 1
TextBox1.Text = TimeOfDay
End Sub
|
|
|
|
|
Hi Bob,
several remarks:
1.
try to be informative and accurate, both for yourself (while debugging) as for asking on a forum.
"it did not work" is useless. Did it compile? did it run? did it throw an exception? was the outcome wrong? did nothing happen at all?
2.
in Windows most timing information is expressed as a number of milliseconds.
which does not mean you get millisecond accuracy all the time (you might read my timers article on that!)
3.
timers need to be started explicitly. A timer that isn't started does nothing at all, so a breakpoint at it's Tick handler would never be hit.
4.
You did not show the Tick handler, where the things are or are not going to happen. It does exist, does it?
5.
please use proper identifiers, that are easy to read and self-explaining if possible.
I would choose "clockTimer" or "timeOfDayTimer" instead of "The_Time_Is".
And I would not keep the automatic names Visual Studio provides, so change "Form1" in something more functional in your app.
Overall, I would suggest you grab your VB.NET book and read it (once more) to brush up on the fundamentals and strengthen some good habits...
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Thanks for your help Luc
Somtime is hard for one to read when thay have dificualty reading and adhd
Overall i think i am doing pretty good
I do apreciater your help Luc
Thanks
Bob
|
|
|
|
|
Bob Beaubien wrote: Overall i think i am doing pretty good
Maybe, but you certainly did not convince me.
If you have 5 timers already, you should know intervals are in milliseconds, and timers need to be started. You should not add a second timer as long as the first one doesn't work...
I strongly suggest you make it a habit to get things working before you add new stuff!
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
all my timers start and stop at difrents times at difrent intervals that is why i have 5
Thay all work but the last one i want to display the time
Thanks
Bob
Go CANADA Go
|
|
|
|
|
I got it figerd out Luc
sorry for bugging you
but i do apreciate your help
Thanks
Bob
Go CANADA Go
|
|
|
|
|
No problem.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
|
Can you include the .NET 3.5 SP1 msi in your installer? It should be able to do the check and return a pass fail on success.
Note in case I get called on it, I didn't actually look to see if the MSI was available but if it is it should be a solution.
|
|
|
|
|
Here[^] is an article that shows checking for SP1 for .Net 1.1. If it exists for 1.1, it has to exist for 3.5 as well. You can try your luck with it. Online only for only an hour a day. Please expect delay in response.
|
|
|
|
|
Seems a little odd to me. When I look at the Prerequisites, it shows .NET Framework 3.5 SP1 and not .NET Framework 3.5.
|
|
|
|
|
The .NET Frameworks Launch Condition does not have the ability to test for SP1 levels.
I found a solution here. This should help you write a check for SP1 in your setup[^] project.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
hi every body iam new to Entity framework i have learned about using SP and how to map (insert \ delete \ update) in every table and how to import function to call SP that returns values from one table
my question is hot can i to call SP that returns multiple columns from multiple tables
in LINQ to SQL generating class that represents all columns that returned by SP how can i use Entity Framework in this case
thanks in advance Every Body
|
|
|
|
|
Hi,
To retrieve multiple records using more than one table, you have to create your custom entity on Entity Framework Model. Follow the below steps:
1. Open Entity Framework Model file (*.edmx) in Visual studio
2. Right click on design pane and select "Add" -> "Entity"
3. One blank entity is created. Just add number of properties which you need to retrieve from the database (please check the property of each columns means data type, Nullable and Entity Key option)
4. After creating custom activity, Right click on design pane and select "Add" -> "Function Import".
5. In function import dialog box, select your stored procedure, Function name and select Return type as "Entities" and select custom entity from the drop down box. Click on OK button.
6. Now you have to call that function to retrieve data from the stored procedure. please find code below:
TestDBEntities1 testdb = new TestDBEntities1();<br />
var p = from d in testdb.GetOrderInfo() select d;<br />
MessageBox.Show(p.Count<OrderInformationEntity>().ToString());
Here TestDBEntities1 is my entity framework class and OrderInformationEntity is a custom entity.
You can find primary information of using Entity framework here.
Hardik Patel
Blog: DotNet Code GuruRegards,
Hardik Patel
|
|
|
|
|
I have a datagridview which is bound to a ms access database, through a dataset.
The user can click one record on the DGV, and open another window with all the data of the record, so that he can edit them,etc.
If he tries to sort the DGV by a column, let's say the date field and then tries to load a record the thing gets messed up.
It seems that whilst the DGV is sorted, the dataset is not equally "sorted".
That means that the user can try to load a specific record but instead he gets a completely different one.
Is there a solution to that ?
|
|
|
|
|
You need to either use a unique key to load the record into the new window, or sort your underlying dataset in the same way as the DGV when the column header is clicked. Bob
Ashfield Consultants Ltd
|
|
|
|
|
You need to either use a unique key to load the record into the new window, or sort your underlying dataset in the same way as the DGV when the column header is clicked.
There is already an ID field which is unique.
How do i sort the dataset ? That's the question in the first place.
|
|
|
|
|
Anyone guys ?
Any ideas ?
|
|
|
|
|
Hello everyone
I have a second form in my program that will keep all the setting for my app
i am having a hard time to get my controls to pull the vavlue from the text boxes that is in the second form
What is the easyest best way to do this ??
or is thare a better way then using a second form
Thanks
Bobmodified on Wednesday, February 17, 2010 3:18 PM
|
|
|
|
|
In the second form do something like this:
public string SomeSetting
{
get { someTextBox.Text ; }
}
Then in Form1:
string mySetting = Form2.SomeSetting ;
Do this for all your text boxes.
|
|
|
|
|
is that for vb 2008 it dont work
|
|
|
|
|
Sorry, that is C#, I don't know VB.
But if you look up Properties, that should get you started.
|
|
|
|
|
Thats cool thanks anyways
|
|
|
|
|
Public ReadOnly Property SomeSetting() As String
Get
Return SomeTextBox.Text
End Get
End Property
Dim mySetting as String = Form2.SomeSetting I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|