|
i have a tabpage control with 3 tab
that it appear on my form normaly
so i want to appear it in vertialy so i set tabpage.Alignment=Left
but in win xp the tabs'Text dont appear .(the caption of each tab)
if i change my windows theme to classic this will be correct
-- modified at 7:50 Friday 4th May, 2007
-- modified at 19:16 Saturday 5th May, 2007
sepel
|
|
|
|
|
|
|
hi Gopal. and thanks for your help
sepel
|
|
|
|
|
Currently working on a desktop application using c# 2.0 and facing two problems
1- i want to prevent user from opening multiple instances of my application
2- i want associated file types (when double clicked) to be open in my application and if the instance of my application is already running then i do not want to open a new instance instead the file opens in the currently opened instance
|
|
|
|
|
1. Search the articles for "single instance"
2. Search the articles for "file association"
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
i had searched for the articles and my first problem was solved
second problem still exists
actually i associated the file types with my application and they are the respective files are opening in my application (in a new instance) when double clicked the problem comes when i try to open the file in already opened instance of my application (something to play with command line arguments)
|
|
|
|
|
IIRC one of the articles covering single instance applications also covered the topic of passing command line arguments (e.g. a file name) received by a second instance to the first and (single) instance. Unfortunately I didn't bookmarked the article, but I think it should be possible to find it. Go through the search results or maybe try combining the search words.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hope this helps
<br />
class App : WindowsFormsApplicationBase<br />
{<br />
<br />
string[] fargs;<br />
public App(string[] args)<br />
{<br />
fargs = args;<br />
this.IsSingleInstance = true;<br />
this.EnableVisualStyles = true; <br />
this.ShutdownStyle = Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses; <br />
this.StartupNextInstance += new StartupNextInstanceEventHandler(this.SIApp_StartupNextInstance);<br />
}<br />
}<br />
Arti Gujare
|
|
|
|
|
i m very thankful to u..
this solves my problem
thankx
|
|
|
|
|
static void Main()
{
bool createdNew;
Mutex m = new Mutex(true, "YourAppName", out createdNew);
if (! createdNew)
{
// app is already running...
//MessageBox.Show("Only one instance of this application is allowed at a time.");
return;
}
Application.Run(new Form1());
GC.KeepAlive(m);
}
here u have just copy paste it and it will work for u .. plz do reply to this
ghumdai firdai
|
|
|
|
|
thankx a lot for replying
this solution does work fine .. but the second problem still exists for me
i-e
i want to open a file (whose type is associated with my application) and if i double clicked the file the file should be opened in the already opened instance of my application instead of opening it in the new instance.
waiting for a solution
|
|
|
|
|
sorry i have no such solution
|
|
|
|
|
1) You can use a static variable in yoor program befor Application.Run(MainForm) like bool _isRunning = false as initial value and upate it in Form.Closed event to false. This idea is simple but not efficient, good and professional and secure.
2) You can store a registry key and check it before Application.Run(MainForm) to see if your application is already running or not. Better but not secure.
3) use Process.GetCurrentProcesses() method and do a search in the result set to check if your process exists. Much more reliable than all but you shoul have a unique process name.
hope this helps...
|
|
|
|
|
hi,
iam krishna working on .net techonologies. In my current project i have a problem in admin module ie., My admin modules consists of 26 links (anchor tag),which will redirect to specified page. each link assigned a unique id. what my problem is when iam logging on to admin panel , depending upon the role of the user who is logging onto admin panel i have to hide the links for the users depending permissions given to them. For this what i have done is i have stored the user roles,formnames , formids,permission(as enabled/disabled)into the database.for Providing the permission for the users the administartor has a user interface,while iam retrieving the enabled formids of a user iam getting the formids into a variable, but what i have to do is, i have to match the ids with the hyperlink ids and make the hyperlinks visible or invisible.
could any one give me the suggestions or solution to this problem.
thanx in advance.
with regards,
krishna
|
|
|
|
|
Its easy but you are making your application very complicated
i don't know why are checking Id if form to control id ?
Store credentails in the database specifying which link should not display for perticular user role and make all those link disable in page load
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
I would certainly suggest that use LinkButton and set its visible property to true or false as depending on role
|
|
|
|
|
hi everybody,
i want to disable CTRL+ALT+DEL,ALT+F4 and ALT+TAb keys through
c# program how can i achieve it.please send some clue if possible please
send some sample code.
|
|
|
|
|
You cannot disable Ctrl-Alt-Delete.
|
|
|
|
|
As Jon said, Windows will not allow you to disable CTRL-ALT-DEL. This is because this particular shortcut is used to signal to the Windows OS that you want to perform some critical action - log off, terminate a program, etc. In fact, in some Windows setups, you are required to press CTRL-ALT-DEL before you login to the system. This is so that you know that you're typing your username and password into a real Windows OS login dialog - not some spoofer.
That said, it sounds like you might be trying to write a screensaver program. Don't worry about those key combinations. Just write your program as a normal .EXE file, then when it is compiled change the file extension to .SCR. Then right-click on the file from Explorer and hit Install. You'll now be able to use this as a screensaver, and Windows should take care of those pesky key combinations for you automatically.
|
|
|
|
|
Use keyboard hooking to do whatever you want. This way, you can hook all the key events in windows for all windows and cancel the ones you don't want to be processed by "your Window".
this topic is not a small one and requires experience. Please checkout google for more information and source code examples.
|
|
|
|
|
I need a regular expression which find the word inside < and >.
For example:
In the following expression,
<this.text> + <<another.text>>
it should only find <this.text>
It should only search words starting and ending with <> not <<>>.
|
|
|
|
|
Is this what you want?
[^<](?<Text><[^>]*>)[^>]
This will result in a named capture called "Text" that contains the string including < and > (but not << and >>) as you specified. I guess you'll have to try it out with a larger data set to see if it meets your needs completely.
-- modified at 5:02 Friday 4th May, 2007
Previous post got buggered w/ HTML tags... ;]
--
Umm... what's a .sig? ;]
|
|
|
|
|
Sorry, have to correct myself yet again! ;] My previous expression would not match at the very beginning or end of a string, so we need to use Zero-width negative lookbehind assertion (?<!) and Zero-width negative lookahead assertion (?!) to make sure that if there is not anything preceding or following the string, it'll match as well. So, here's the full expression:
(?<!<)(?<Text><[^<>]*>)(?!>)
--
Umm... what's a .sig? ;]
|
|
|
|
|
Thanks
its working fine, is there any way that we can restrict the selection by the no of < and > signs. For Example if i want it neglect <<< and select <<.
|
|
|
|