|
on valuechanged event of numericUpDown use following code
Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown1.ValueChanged<br />
call button1_click(nothing,nothing)<br />
'or<br />
button1.PerformClick()<br />
End Sub
hope this helps
|
|
|
|
|
Why are you clicking the button?? Why not just handle the ValueChanged event of the UpDown control and call the code that does your calculation from there??
|
|
|
|
|
Hi All,
I want some information regarding Windows Vs VB. For Ex. if I want examples which work with VB 6.0 to handle desktop functions. can anybody have some info please provide me.
Thanks in advance.
|
|
|
|
|
VB6 is a dead language and examples are becomming more and more scarce. I highly suggest moving to VB.NET. As for examples, you're going to have to be a lot more specific in what you want to do with "desktop functions". At this time, the only thing we can do is direct you to Google and start searching for examples.
|
|
|
|
|
Hi .
i want to zoom the image using mouse press dragging.
i need coding for that in c# or vb..
plz anyone help me.
very urgent..
thanks in advance
gopal
|
|
|
|
|
We're not going to write your code for you. YOU have to write the code and when you get stuck with a specific problem, then we'll help.
At this time, the only thing we can help you with is tell you to go to Google and start searching for examples, probably using search terms like "c# image zoom", or go to Rent-A-Coder to pay someone to write your code for you.
|
|
|
|
|
This is so trivial that if you don't have the resources to learn how to do it, it means you probably have no VB books, which is probably why you have no idea how to do this and seem to think that telling us your laziness is 'urgent' is the way to resolve the issue.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Probably simple for most in here but I am trying to find how to convert an xls file (Excel) from "Read Only" to it's opposite. Here is the code I have:
xlsBookTs = xlsApp.Workbooks.Open("F:\filename.xls")
ExcelTsOpen = True
xlsSheetTs = xlsBookTs.Worksheets(1)
xlsBookTs.(((NEED HELP HERE)))
xlsBookTs.SaveAs("F:\filename\ts" & Format(Me.MonthCalendar1.SelectionStart, "yyyyMMdd") & ".xls")
ExcelTsSaved = True
Basically it loads the default file ("F:\filename.xls") and saves it with the date but needs to be in an adjustable format when it Saves As.
Many thanks in advance to those who offer usable advice.
|
|
|
|
|
Why is the workbook read only?
If it's protected, you can call Unprotect, if the file has readonly-flag, you can remove it, although I think that if you save it using SaveAs, the readonly flag won't be set to the new file (not sure though).
|
|
|
|
|
Sadly the new file saves as a Read Only. The initial default file is read only to protect it.
|
|
|
|
|
Is the file read only, or is it protected (using excel) and therefore read only? Also check that the saved file isn't open in your app (that you call close on the workbook).
|
|
|
|
|
The file loaded is read only, not Excel protected. I need to save it as another name (easy) but remove the "read only" setting (hard part) in code.
|
|
|
|
|
Ok, It's fixed now. Sadly I don't know how or why. Thanks for replying.
|
|
|
|
|
Once an Excel file is opened "ReadOnly", that's it. You can't change that unless you close the file and reopen it with full access. Your only option is to save the workbook to another file using SaveAs.
|
|
|
|
|
I am trying to save it with a Save As, only the Save As is also saving it as read only. I need to use code to disable the Read Only in the converted file at Save(SaveAs) time.
|
|
|
|
|
The file cannot be saved as ReadOnly. Only when you open the file does this come into effect. Possibly your code still has the file open after it's saved??
|
|
|
|
|
Hi dave. I realize the read only cannot be saved.
The file loaded is read only (not Excel protected). I need to save it as another name (easy) but remove the "read only" setting (hard part) in code.
For some reason, the new file, although saving under the new name as I have wished also carries the "Read Only" setting from the original file that was copied.
I need to change that during the "Save As" part so as to remove the "Read Only" setting on the newly named and saved (SaveAs) file.
It needs to be done in code also, not via manual access from the windows explorer.
Thanks for your time and efforts so far Dave.
|
|
|
|
|
frankiebaby2 wrote: but remove the "read only" setting (hard part) in code.
Last time: THERE IS NO READONLY SETTING! The file is only determined to be "ReadOnly" when it is loaded by Excel. If the file is already open by another process, or another instance of Excel, the file will be opened as "ReadOnly". THERE IS NO SETTING IN THE FILE THAT DOES THIS.
If the file was just saved as a new filename, but you haven't closed it in your code's instance of Excel, ANY ATTEMPT TO OPEN IT IN ANOTHER INSTANCE OF EXCEL WILL RESULT IN IT BEING "READONLY".
|
|
|
|
|
I am working on a project that requires me to extract (and record for later use) the WORKnumber which is always stored in the first line of a text file (WO*1234). I am tring to find a way to dynamically replace this number with WO*9007, but I always want to record the original work number before replacing it. I am fuzzy on how to write code for this. Can I get some help on this? I am a relative newbie. Thanks
|
|
|
|
|
its not 100% clear if you want to write a new file with the same name, and the replace WO*9007 entry as the first line or not .. so Im going to proceed on that assumption. You need to write code to do the following steps :-
0) declare and set a line counter variable to 0,a string var and set to "" (empty string)
1) rename the original file - include .tmp or .bkp as the extension
2) open the renamed file from (1) for reading [input]
3) open a new file with the original name for writing [output]
4) construct a loop to read the input until End-of-file
5) read a line from [input]
6) increment a line counter
7) if the line counter variable is 1 and the line contains WO*1234 substring/extract out the WO*1234 part, replace it with WO*9007, and write it to [output]. Store the WO*1234 part in the string variable - that could be about 4 simple steps
8) write every other line to [output]
9) (eof of file)/loop
10) close input
11) close output
12) if no errors, delete the .tmp or .bkp file
what do you think about that set of instructions ? its all doable, there may be some improvements, but its simple steps. Now, you code them - come back to us when you have code you need checked.
'g'
modified on Saturday, January 24, 2009 12:40 AM
|
|
|
|
|
OK. I got that. What I had to do was to change my design approach; rather that extract the number, I provided a 2nd text box for users to record the number in th applet. Now, I want to add "REF 007" in a new line immediately after every occurence of "PER*980" in the text file (it will always occur multiple times).
Here is what I have coded so far; but nothing happens:
Dim refNum As New IO.FileInfo(lblWorkFile.Text)<br />
Dim writer As IO.StreamWriter = refNum.CreateText()<br />
writer.WriteLine(txtWorkDetail.Text)<br />
writer.Close()
I would at least think a new blank line would be inserted.
|
|
|
|
|
I've created a big program (2.5M) and it's loading slowly on startup. Could someone please point me to ideas on how to improve this. Many of the subroutines are rarely or never needed by many users. So I'm thinking of putting them in separate .dlls. Would that help?
Tia
|
|
|
|
|
Breaking the application to smaller pieces using dll's would help.
However, if the application size is 2.5MB and it's starting up slowly, I would guess that the problem is somewhere else. Perhaps you're doing lot's of initializations in the beginning.
Also you could check the compiler settings and let it do optimizations and remove the debug constant.
|
|
|
|
|
If you've got a ton of code in your startup form or an excessive number of controls on it, then this is going to be a problem. To partially solve the problem of a large code-base, you can move non-UI involved code to another class (class library). If you have an excessive number of controls, there's nothing you can do about it except re-design your app. You can also try running NGEN on the installed application to generate the native code assemblies for that machine, but don't count on a huge performance gain from this.
|
|
|
|
|
Thanks to you both. So the code in the class libraries is not loaded by my program until it is needed, saving time on startup? Is that the idea?
|
|
|
|