|
private void OnToolbarButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)<br />
{<br />
switch (this.ToolBar1.Buttons.IndexOf(e.Button))<br />
{<br />
|
|
|
|
|
Hi,
is there any way or method to find out the Ascii code of the character that is typed in the text box.
Actually, i'm trying for a textbox that only accept numeric values/symbols (that is 0 to 9). Because i don't want to let my user to enter any character or special symbol except decimal point.
if anybody have any idea than please do let me!
With Thanks.
|
|
|
|
|
Add an Event handler to the text box
this.textBox1.KeyDown += new System.EventHandler(this.textBox1_Keydown);
This allows 0-9 and backspace.
private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if(!Char.IsNumber(e.KeyChar) && e.KeyChar != (char)8)
{
e.Handled = true;
}
}
|
|
|
|
|
Thanks a lot Darren Marshall!
its as simple as was in VB 6
Thanks and
Best Regards.
|
|
|
|
|
Hi..
I want to make an application in C#.Net to call user of google talk through
login by my google account..
Is there any apis.
If code or apis are there please give it to me.
Rahul Kulkarni
|
|
|
|
|
There is no Google Talk API, the only way you can control things is to write a program that uses the Windows API to control the Google Talk window. i.e send mouse clicks etc etc. Which is pointless if your at the computer because you can just use the Google Talk app.
|
|
|
|
|
i want to make one application in vc#.net which launch from windows control panel . i dont know how to make in vc#.net . i know that in VC++ we use CplApplet for this . can you help me in developing application in vc#.net
|
|
|
|
|
|
i am not gettiing much from this link. can you please give me some code for use windows APIs in C# like how to use CPlApplet in C#
|
|
|
|
|
I am extending an panel. Now my problem is , when i click on the panel it should get selected. I can any no of control to this custom panel. do i need to subscribe to all the mouse events such mouse down and set the focus to the panel in order to get selected.
In the custom panel, how can i aceive drag and drop in the panel Assume that i have inherited from a panel and i have internally divided the panel into 4 parts and now i place a control on 1 part and the user should be able to drag the control at 1 and place it 4. Can anybody sugges me how to acheive this.
Thanks 4 answering
Regards,
Rajesh
|
|
|
|
|
Hi guys,
I have a single form to control my application and rather than use multiple windows it switches out the main panel depending on what view the user wants.
My problem is that its not very effective and wondered if you can point me in the right direction to get a flicker free app.
Should i go with this idea or is there anotehr solution?
Add all panels to the Form at run time (shouldent be a problem since there are only 3-6) Show the current panel while Hide the rest. While having a seperate thread update the 'main' and sleeping panels every say 1/2 second.
Thanks,
Darren
|
|
|
|
|
Code is like this:
public void ShowHome()
{
this.Controls.Remove(currentPanel);
currentPanel = new App.Main.MainPanel();
this.Controls.Add(currentPanel);
currentPanel.BringToFront();
}
public void ShowSecond()
{
this.Controls.Remove(currentPanel);
currentPanel = new App.Main.SecondPanel();
this.Controls.Add(currentPanel);
currentPanel.BringToFront();
}
what i was thinking from my previous post was to add all panels at runtime and just .Hide() and .Show() them but have a second thread update them all periodically.
|
|
|
|
|
There are 2 ways to do it:
1. Use this.SuspendLayout() before your code and this.ResumeLayout(false) after your code.
2. Use Visible = true or false to Show or Hide panels.
|
|
|
|
|
Yeah i tried using .Hide() .Show() (not sure if that works the same as Visible and sets the same flag) but trouble is the panels generate content on specific things so if something has changed and i switch to the new panel the panel hasn't updated if you see what i mean.
Any ideas?
|
|
|
|
|
Ok i tried quite a few things but i think i have a new solution:
Im going to create a TemplatePanel Abstract class that derives the Panel class and contains a Update() method, of which any app panels must derive.
Then i will run a thread that periodically calls the Update() method for all panels if the application is not minimised.
If anyone has another solution then please let me know,
Thanks
Darren
|
|
|
|
|
How We can get information about the nodes attached on LAN programatically ven v r on server?Is there any method already present in C#?
thanks in advance
|
|
|
|
|
|
The ARP table might only hold ip addresses of computers it had reason to communicate with though, not sure on that.
|
|
|
|
|
Hi
I am writing a windows application using C# for performing a task as scheduled. Now I am calling a method which does the needful inside the form1 constructor
which is inside the main method like this:
static void Main()
{
System.Windows.Forms.Application.Run(new Form1());
System.Windows.Forms.Application.Exit();
}
now what is happenning is that the control does not reach this statement
System.Windows.Forms.Application.Exit();
and I need to manually close the form which is not what I want.
I want the application (and the form) to close by itself.
How can i do this.
Thanks in advance,
Aryan.
|
|
|
|
|
Set timers to enabled true
private void timer1_Tick(object sender, System.EventArgs e)<br />
{<br />
Application.Exit();<br />
}
|
|
|
|
|
System.Windows.Forms.Application.Exit(); does not get executed because your program is running an open window on a thread. It will never reach System.Windows.Forms.Application.Exit(); because when you close the window Dispose would have been called already.
Can i ask why you are using a window? If it is to run a scheduled task why not just create a Console Application, this will exit once it has finished executing. If you have the window so you can enter data about what it is you want to run, why not just add switches to execution of your console application like Start -> Run 'myapp.exe "path to filename" "time to start"'
Like this:
http://www.codeproject.com/csharp/deleteold.asp?df=100&forumid=152583&exp=0&select=1169916[^]
Darren
|
|
|
|
|
hi all,
I have a class which has a functions to generate XML files based on given parameters, Move these files from one machine to another and execute these files over a database.
Iam able to call these functions fine on a button click event.
It is required that the functions all be automated ..
I tried this by calling these functions from a windows service(C#) in the OnStart() method but i see that they are not executing...
I am not able to debug the windows service.
How can i automate the execution of my class functions using windows service or some other kind of scheduler?
Thanks in anticipation
|
|
|
|
|
See this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskDebuggingServiceApplications.asp
|
|
|
|
|
I want design report that receive from xml file in C#, but error "load failed" and must add datasource when restart project.
everybody can help me. thanks!
|
|
|
|
|
Hello,
I'have to create an application that uses a listView. The listView in C#.net 2003 has grid with horizontal and vertical lines. How can I do so as I can make it have only vertical lines? If possible, help me please.
|
|
|
|