|
The TopMost call gets called and is set to true. But when I set a breakpoint further on when something else happens and I look at the TopMost value, it is False and so the setting is never held. I never set it back to False so it can't be holding its value (well its not being set properly I guess).
Its confusing !!!
Nigel
|
|
|
|
|
Well, it works and it sticks. The only three things that can change that are:
1: You change it back to False.
2: You create a new instance of your form somewhere along the way and assign it to the same variable, thus giving the appearance that it didn't stick.
3: Some other form set TopMost to True somewhere else in your app.
|
|
|
|
|
|
uk_nbb wrote: and are run as their own threads
I am not sure what you are saying here, are you having some other thread create
and handle a Button ?
All Controls require they be touched only by the thread that created them,
which in practice means everything gets created and touched by the main thread
(aka GUI thread only), since thats where your first Form gets created, and normally
everything in one way or another connects to it.
There are a few properties/methods that dont have to obey this rule; mainly
InvokeRequired and Invoke() and its exactly these that you must use to
let another thread do something to a Control it did not create.
If you dont follow the rules here, on old .NET (prior to 2.0) it may or
may not work, typically it will suddenly ignore you or freeze, show a white
menu bar, things like that. Since 2.0 it will throw an InvalidOperationException
except when you have set CheckForIllegalCrossThreadCalls=false, which is
considered bad practice and brings you back to the 1.x behavior.
Hope this helps.
|
|
|
|
|
I think Invoke() may be my missing link.
I will read all about it and have a go.
Thanks
Nigel
|
|
|
|
|
i want to make a textbox that would only accept numbers as an input...
can you please give me sample codes. thanx!
i am using vb.net 2002 (desktop application)
|
|
|
|
|
i already got the answer to my own question... in case somebody else will need it
here's what to do:
--put the following code in the Key_Press event of the textbox control.
If e.KeyChar.IsNumber(e.KeyChar) = False Then
e.Handled = True
End If
--then that's it! it would only accept numbers!
|
|
|
|
|
One update.
e.Handled = Not (Char.IsNumber(e.KeyChar) or Char.IsControl(e.KeyChar))
I have shuffled the code a little, but either way, the core thing is that you check Char.IsControl, otherwise things like backspace will not work.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
youre right! i didnt check that! thanx!
|
|
|
|
|
Hello,
I have written some reports in Crystal Reports XI Release 2 and calling them from VB.Net (2.0) application. Application resides on server and all clients (more than 300 machines) access/run it over the network.
Is there any way to deploy crystal reports on the server and all clients can be able run it or I have to install CR component on each client computer.
I am having the same problem with DSOFrammer control.
Your help will be highly appreciated.
Regards
Nas
|
|
|
|
|
|
Hello Ben,
Many thanks for your instant reply. You mean after installing this crystal reports server control on the server, I dont need to install anything on client machine in order to view reports within vb.net application?
|
|
|
|
|
Unfortunatly no. If you application is running the crystal report on the client PC, then it will also need to be installed on each client machine.
In my use of crystal reports I have a middle tier web service that actually creates the crystal reports then sends a word doc down to the client. So in that case since I am only running crystal reports in that middle tier web service, the report files and the install only need to exist on that web server.
In your case the report files and the crystal install will need to be installed on the client. Which is kind of a pain.
Ben
|
|
|
|
|
Many thanks Ben for your brief answer. I had a feeling that we gonna end up installing crystal reports on each client machine but wanted to check if someone has cheated crystal reports for this problem.
Anyways I appreciate your prompt responses.
Nas
|
|
|
|
|
Note, the link I provided in the above post is not a full version of crystal it is just what is needed to run the reports.
Ben
|
|
|
|
|
Hi all,
I have a MDI names as MainForm and in that MainForm MDI i have a menu item names as File
to the File Menu item i have a form named as 'Employees',
Here in my 'Employees' form i have a button names 'AddEmployes'
Whenever user clicks on 'AddEmployes' Button a form named as 'Employee Details' will opens,
NOW MY PROBLEM IS --When the user selects one employee department of 'Employee Details' Form and selects Save Button of 'Employee Details' Form
data of THE 'Employee Details' Form is saving and the 'Employee Details' Form is CLOSING..
ALL I need is i need to make the Employee details form to be in to the same state allowing the user to select another option..
I've tried in several ways,(taken Dialog box at last) and left with no answer,
I don't want to use DialogBox option,,,
Please help me
Thanks in advance
Prashanth
|
|
|
|
|
I have a program that search for files. I created an access table that include excluded files and file paths. Here are the fields:
ExcludePath: ExcludeFileName:
C:\Windows\Media\recycle.wav recycle.wav
C:\Windows\explorer.exe explorer.exe
C:\Windows\Help\camera.chm camera.chm
I need to know how to check this table to see if the file exist. For example, if the file exist in the db then add ExcludeFileName to listbox2.
jds1207
|
|
|
|
|
File.Exists
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
hi i want to fetch time frome system with milliseconds in the format of hr:min:s:milliseconds how we can do this
pls tell me if not possible inthis way then tell me some other way in which we can fetch the same or equivalent
with regards
Balagurunathan.B
|
|
|
|
|
|
try this
dim stringDate as string
stringDate = Format(dateValue,"HH:mm:ss")
--dateValue is the given date
--format function returns string
if you want to have a datevalue then try this:
dim newDate as datetime
newDate = Date.Parse(Format(dateValue,"HH:mm:ss"))
--hope this would help!
|
|
|
|
|
yeah, now add .fff to the format string to get fractions of a second.
|
|
|
|
|
I m using Visual Studio 2005. How can I drag and Drop Table From Data Connection Node of Server Explorer to Form. I have done it n Visual Studio 2003. But I m not able to do this in 2005. Does VS 2005 does not support it, or ther s a special method for that.
Thanks in Advance
|
|
|
|
|
Not sure about whole tables. I drag and drop fields from tables and views with no problem...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
hi
i am doing a project in which creating log files for the users signed on . its automated input process so i will be writing each and every input in log file .
log file is a .txt file i am appening the file using streamwriter
at the same time i am trying with another button to read the file using stram reader or any io.files.readalllines() but its not allowing to read. how i can read the file while some strea writes into it. please any one tell me this. i cannot close the stream each and every time as the process is automated for testing purpose.
with regards
Balagurunathan.B
|
|
|
|