|
VB.NET sucks. I think if you but the statement all on one line, you don't need endif, nor can you use elseif
if intscoretop < 5 then
blah
elseif
blah
else
blah
endif
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sorted cheers, didnt realise they had to go on seperate lines, i was trying to concatenate them!
|
|
|
|
|
When you open a font dialog box in vb.net a change the font, how do you save the changes that was made to the font. Could someone send me some sample code on how to save changes in vb.net?
|
|
|
|
|
Save changes how/where ? Do you mean just keep the details of the font for next time ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes, just keep the details of the font for next time.
|
|
|
|
|
That used to be the propertybag object in VB6 it didn't get carried over to .Net. I've used a XML file in the past to save and recall the information I needed.
Hope that helps
|
|
|
|
|
In your application properties, go to settings. Here you can add properties that can be change and saved at runtime. Click the first item that says newsetting etc. and type "SaveFont" when prompted.
Then in the type you can select system.drawing.font or something along those lines.
Then in your code:
If fontdialog.showdialog = OK then<br />
my.settings.savefont = 'font you selected<br />
end if
On form load you can then reload the setting:
dim myfont as system.drawing.font<br />
mycontrol.font = new font(myfont.fontfamily,myfont.size,myfont.style)
Note:This will not save the font colour only style, size and font family. If you want to save font colour you will have to add another setting. Also note my code might not be 100% accurate but its pretty close.
Posted by The ANZAC
|
|
|
|
|
Hi there,
I'm brand new to .Net...so forgive me if this question is basic. But i'm trying to load text files into an Oracle Database, and I wanted to use sqlldr to complete this task in VB.Net. I have the control files created, I just need to know what is needed "codewise" to utilize sqlldr. Is there a class that handles this functionality?
thanks in advance,
Darryl
|
|
|
|
|
Why is this bring up a syntax error (the error it states is on the open brackets):
---
If intScoreTop < 5 then (My.Resources.Sounds.sndMainPopupLow, AudioPlayMode.Background)
---
All i am trying to do is if the integer intScoreTop has a value of less than 5 then play a sound file!
|
|
|
|
|
Because you're not calling any method that plays a sound, it looks like the method name is what's missing, and you're just providing the params to the method which you're not specifying.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Ha ha, me being dumb, needed to call the my.computer event.
Cheers
|
|
|
|
|
Hey everyone,
I am working on this project, mostly database driven.
this is what it is about:- The user interface is install on three computer in different location while the database is kept on another computer in a seperate location, which means all three computers has to connected to this sql server to enter and retrive data. That means if the server goes down.. neither of these location will be able to continue there work.
What i am thinking about now, is to install sql server on all three machine so that data is stored at each location and at the end of each day all the data from the three location would be uploaded or Synchronized to the main database.
Problem.. how do i get all three database to Synchronize with the main database? Do i have to hard code this to happen or is there a feature that does this in sql 2000...
your help would be highly appreciated...
thanks.
Nab
|
|
|
|
|
My recommendation is to have a backup server that mirrors the other server on a regular basis. I think you are going to have a real headache with trying to synchronize at the end of the day. I don't know of anyone who does it that way.
_________________________________________
You can't fix stupid, but you can medicate crazy.
|
|
|
|
|
thanks, would you suggest that i write a utility program to do so? one that copies all table to the backup database...and at the same time be able to access the information from server level or standalone at anytime..
Nab
|
|
|
|
|
No. You let SQL Server handle the replication between two servers.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
In Visual Basic you can do this job by Now function
|
|
|
|
|
Could you give me an example?
|
|
|
|
|
Okay it is easy actually. Just place a timer on to form and set its interval to 1000 (1 second) and examine the sample below. Every second it will assign the new date and time to textbox1.text. If you want to show only time remove the remark in front of second line.
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
TextBox1.Text = Now ' shows date and time
'TextBox1.text = Hour(Now).ToString + ":" + Minute(Now).ToString + ":" + Second(Now).ToString
End Sub
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
I have a form with multiple bindingsource and table adapter controls. I want to iterate through the entire list of these controls and execute an endedit and update. Is there a way to iterate through them like I can through other controls on a form?
|
|
|
|
|
Don't know if this will work.
dim b as bindingsource<br />
for each b in me.controls<br />
if (TypeOf (b) Is Binding Source) then<br />
b.endedit()<br />
b.update()<br />
end if<br />
next
Posted by The ANZAC
|
|
|
|
|
No that will not work. It has several problems. One the bindingsource controls are not enumerated in the controls collection. That was the whole reason for my inquiry.
Secondly an invalid cast exception is received because each control in the controls collection will be cast as a bindingsource. Third I want to use the update method on the associated tableadapter. There is not an update method in the bindingsource control.
"binding Source" with a space? This causes a compile error because a bindingsource can never be a systems.windows.forms.binding.
|
|
|
|
|
Okay, I have a school assignment in which I have to use a DateTimePicker for both the date (calendar), and for selecting an events start time, and end time...
What I need to know, is how to get the thing to let me select time without seconds (I know, custom format), and to hop by 30 minute increments..
Please help... I know it's easy, but time is pressing.
"Beware of bugs in the above code; I have only proved it correct, not tried it."
|
|
|
|
|
Hi Chris,
I dont think there is any control for your requirement. what you can do take two NumericUpDown control.For 'minutes' set control's "Maximum" value to 30 and "Minimum" value to 0 and "Increment" to 30.Take a Combobox for AM and PM.Now create Time variable from this control input.
I dont know any better solution.
Live life to the fullest
|
|
|
|
|
That should work well... thanks for the reply.
I was also thinking about using ComboBoxes, and adding all the increments manually, then just in code, have it find and remove the : and AM or PM characters (after storing them ofcourse) then convert to an integer (CINT) and compare what's left (630 > 600 then HalfAnHour=True)
Still have some thinking to do... but it's due tommorow and I'm still hanging. The reason I have hesitated with the NumericUpDown controls is that I need fields to autopopulate on the lostfocus event of the end time. (and that's a little hard with 3 controls per time)
"Beware of bugs in the above code; I have only proved it correct, not tried it."
|
|
|
|