|
shakizil wrote: I am new to VB.Net and just want to get over with this stupid project.
Why does this scream "HOMEWORK ASSIGNMENT"???
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote: Why does this scream "HOMEWORK ASSIGNMENT"???
Don't look the people in that way. I usually meet this problem. I don't have any home work from school. But sometime i have my own idea to build an application, sometime i have an idea to do it but don't know how to code it.
|
|
|
|
|
Roath Kanel wrote: But sometime i have my own idea to build an application,
I seriously doubt that's the case here, simply because of this one statement he made:
...just want to get over with this stupid project.
This is telling me it's something he doesn't want to do. The only thing that fits his profile of a newbie and an assignment he/she doesn't want is homework.
I, and many people here, will not write someones homework assignment for them. That's what RentACoder is for! We'll help with code that is already written, but won't write it for them.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Originally yes, the first reply is correct, although another alternative would be to set the textbox.text property value. Say for instance you have a text box named txtbxdate and a date & time picker named datetm. You would need to set the code of the text box to equal the date selected from the date & time drop down. It would look something like this
txtbxdate.text = datetm.selecteddate
or something like that I'm not actually running visual studios so I don't know exactly what the date & time picker property looks like but i know you can set the text of a text box to the date & time selected on the date & time box.
~ Mike
|
|
|
|
|
Never mind. I got it.
Its only a one line code that takes care of the problem.
Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged<br />
Me.txttrgdt.Text = Me.DateTimePicker1.Value.ToString("MM/dd/yyyy")<br />
End Sub
There you go guys.
And Dave this is not a HOME WORK ASSIGNMENT.
Thanks.
|
|
|
|
|
Hi,
What is the correct way of determining whether or not (part of) a control is visible on the screen? (i.e. when graphics in the control is continuously being updated, requiring a lot of processing that you'd want to save if the control is not even visible (when its parent window is minimized or overlapped by other windows, etc.)
Thanks
Jim
|
|
|
|
|
If Windows wants the control redrawn, it'll tell you. You don't have to worry about redrawing if you don't get a Paint message. What you might want to do is check to make sure your controls Visible property is set and not paint your control if it's false.
Simply, if your control is not visible, Windows won't send you any Paint messages, even if Invalidate is called on your control. No Paint messages means your control won't paint until Windows determines that your control has, at least, a tiny bit of it visible.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks, but I am talking about the situation when I (not Windows) want to have it redrawn because I want to change its contents, not because it needs repainting. (so there won't be any Paint event).
|
|
|
|
|
Well, the only other method you have is redrawing on a Timer event. In the tick, you Invalidate your own control. Then you'll get the Paint event sent to you, IF any part of your control is visible.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks. My application is multithreaded so I wont need the timer event. However, your answer reminded me that I should use Invalidate and the Paint event instead of directly calling redrawing functions!
Thanks again
|
|
|
|
|
I have a small program in vb.net that until today worked perfectly. All i did was change some icons (form icons and the program icon) and recompile . Now i am seeing some odd behavior and cant figure out why. The program still works perfectly when run from the IDE (VS2003) but the built exe generates an error which i can trap. The other odd thing is that the file size of the exe has dropped from 567kb to 450kb.
Any ideas?
Jon
|
|
|
|
|
jonathan15 wrote: but the built exe generates an error
And that would be ______________________________??
Without that, it's pretty impossible to tell you anything useful. The code that generated the error would also help.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The error is "Object reference not set to an instance of an object. at In_Sync.frmMain.StartMe() in C:\Visual Studio Projects\In-Sync2\In-Sync\Forms\Form1.vb:line 229" which i log in the event log.
This relates to this section of code:
For Each parkToChange In setupDetail.Parks
SetAvail(parkToChange.ParkCode)
Next
Setupdetail.parks is a shared property so in form1 this is not instanced it is simply called. Of course in setupdetail an instance of the 'Parks' object is created and populated with 'Park' Items as in this next bit of code (setupdetail.loadvalues).
Dim myparks As parks = New parks
If Not mFirstRun Then
Do While secureReader.Read
Dim mypark As park = New park(secureReader.GetString(1), crypto.Decrypt(secureReader.GetString(3)), secureReader.GetString(0))
myparks.Add(mypark)
Loop
Else
Form1 is set as the startup object and should call Setupdetail.loadvalues before calling the startme rutine which is generating the error. As in the code below:
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
setupDetail.LoadValues()
StartMe()
'Add any initialization after the InitializeComponent() call
End Sub
The thing is it all works when run through the IDE so debugging is not possible. I have tried to log events at key stages and found that Setupdetail.loadevents is never entered. So that is why i get the error because setupdetail.parks does not exist. My real question is why is it never run. Could the form be corrupted.
Jon
|
|
|
|
|
Let me get this straight:
Public Class Form1
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
setupDetail.LoadValues()
StartMe()
'Add any initialization after the InitializeComponent() call
End Sub
Public Sub StartMe()
For Each parkToChange In setupDetail.Parks
SetAvail(parkToChange.ParkCode)
Next
End Sub
End Class
Public Class setupDetail
Public Shared Property
blah, blah, blah
End Property
Public Shared LoadValues()
Dim myparks As parks = New parks
If Not mFirstRun Then
Do While secureReader.Read
Dim mypark As park = New park(secureReader.GetString(1), _
crypto.Decrypt(secureReader.GetString(3)), secureReader.GetString(0))
myparks.Add(mypark)
Loop
Else
...
End If
End Sub
End Class
Is this about correct?
Why is this setupDetail class using all Shared stuff? What you're doing would be much better off as a normal class where all the methods to populate and manipulate the Parks collection are public, not shared. Everything you're doing is manipulating public data from outside the class that contains it. This is a no-no according to normal OOP practices.
I'd rewrite your Parks collection into its own class, supplying public methods to initialize itself and manipulate the collection and its data. You can then create an instance of this class, even follow the Singleton Pattern[^] to create a globally single instance of it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yep, I accept that this isnt the best way to do things and when i planned it there were only 2 shared properties in this class and 1 shared method to get the data. It does need redoing but at the moment it works so im not going to touch it.
With regard to the initial problem, i rebuilt the application by opening a new project and adding the existing files (except form1) then re-created form1 from scratch. Guess what, It works.
Thanks for your help though. I appreciate you spending the time to look at it for me.
Thanks
Jonathan
|
|
|
|
|
jonathan15 wrote: It does need redoing but at the moment it works so im not going to touch it.
jonathan15 wrote: With regard to the initial problem, i rebuilt the application by opening a new project and adding the existing files (except form1) then re-created form1 from scratch. Guess what, It works.
If you needed to do this to get it to work again, you need to rebuild the class quicker than your think. Is what you did to get it to work again a supportable solution? I don't think so. I think you're living on borrowed time now. I'd be rewriting this thing first thing in the morning so any future changes to the code don't break it again.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Just Tested it some more and it is definately not entering setupdetail.loadvalues when run from the exe but it is when run through the IDE. This happens even if i move the call from sub new to the start of startme routine.
Why would it do this?
Jon
|
|
|
|
|
Hi,
I'm using vs.net 2003, and i want to make a program for the smartphone,what i want is just a simple window that contains a command button for exiting the program, and if i push the "X" (that is available on the upper right side for the pocket pc screen) the program will not be closed but the window will be hide and a small button will appear on the today screen that can i move it wherever i want, and i want to return to the program if i push this button.
Im using visual basic.net
Thanks
Smart
|
|
|
|
|
SmartSDR wrote: Who can do this ??????
Are you asking if someone here will write this for you?? Not going to happen... It's not what we're here for.
If you've got a specific question about a coding problem you're having, by all means, ask away! But, please, be specific when explaining the problem.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I'm asking how to make this? i don't know how to make it.
I didn't make any program for the pocket pc.
And i need someone to help me to make this cause i want to make a dictionary for the pocket pc.
Thanks
Smart
|
|
|
|
|
First, the .NET Compact Framework doesn't support everything the full .NET Framework does. Soooo, writing app's under the CF is a little different. I suggest you start writing your app with just putting a form up and being able to close it the normal ways. Get the base functionality down first, like doing lookups in your dictionary, before you start goofing around with preventing the form from closing by clicking the little X.
Get used to doing things the normal way first...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I use .NET as i said i use VS.Net 2003. Also with the SDK 2003.
I'm not a beginner in the programming field, I'm a programmer since 1995 when i had Commodore Amiga 500 & 1200.but i didn't program for the smartphones.
About making form and close its easy. but what i want is about the button that can appears on the today screen for the pocket pc (any custom button that has a shape).And i want when i push this button the main form appear infront of me again.
Thanks
smart
|
|
|
|
|
If what you want is close the application instead of hiding it, set the MinimizeBox property for the form to false .
This will change the 'X' button to an 'Ok' button and this way the program actually closes instead of minimizing when you press that upper right button.
daniero
|
|
|
|
|
Thanks for your answer, but i didn't mean to close the application.
i want when puch the button X or OK to minimize the application and to appear a custom button (any shape that you can make like a button) and this button i want it to appear at the today screen, and when i push this button again i will return to the program.So i don't to close the application.
Thanks
smart
|
|
|
|
|