|
hi,
I'm not sure what you are trying to do..and i think there may be a problem with your syntax:
I tried something similar as follows:
function check()
{
var al=new Array();
al[0]=1;
al[1]=2;
for(var j=0;j<=3;j++)
{
//alert(window.document.Form1.Text3.value);
alert(al[j]);
if(window.document.Form1.Text3.value==al[j])
{
//alert("in");
return true;
}
else
{
alert("else");
//return false;
}
}
}
|
|
|
|
|
My application has three users 1.Administrator 2.Cash collector 3.User .If somebody has logged in as administrator he should be given access to all the drives ,desktop etc. if he is a cash collector he should be shown only one shortcut on the desktop and other shortcuts should be disabled and if he is a user he should be shown only one folder on C drive.
Is there any way to implement this functionality.
Thank you.
|
|
|
|
|
hi all,
i have a function like this in my form1.cs:
public void SendAll(string str)
{
for (int i = 0; i < Soketler.Count; ++i)
{
if (((Socket)Soketler[i]).Connected)
{
ns = new NetworkStream(((Socket)Soketler[i]));
sw = new StreamWriter(ns);
sw.WriteLine(str);
string[] dataread = new string[3];
char[] splitter = { ' ' };
dataread = str.Split(splitter);
txtOdaNo.Text = dataread[0].ToString();
txtKiraBaslangic.Text = dataread[1].ToString();
txtKiraBitis.Text = dataread[2].ToString();
cmbCOSaati.Text = "12:00";
button12_Click(sender, e);
MessageBox.Show("Kiralama Kodunuz!!!\n\n Ciktisini Almak Ister Misiniz ?"," Kira Kodu Bilgisi",MessageBoxButtons.YesNo,MessageBoxIcon.Information);
sw.Flush();
}
}
}
bold line represent a button on my form. i have a user interface and some textboxes. these boxes may be filled both manually by typing from keyboard or they can be send via tcp/ip as a string with " " (a space) in each data.
then i parse the string according to that space and assign each value to the corresponding textboxes.
the problem is this: if user fill datas manually, s/he can easily press the button12 to run it. but if datas were send via tcp/ip and textboxes filled by parsing, button12_click(sender,e); doesnt work in my function
i get these errors:
> the name 'sender' does not exist in the current context.
> the name 'e' does not exist in the current context.
how can i solve this problem and make button12_click work in my function as well ?
help please,
thanks in advance, bye.
|
|
|
|
|
The following should work:
button12_Click(this.button12, new EventArgs());
"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
|
|
|
|
|
Even better:
button12_Click(this.button12, EventArgs.Empty);
|
|
|
|
|
|
In the project I am working on ,I have one exe running 24*7 on Kiosk and its size is FullScreen. I need to start one exe (login application)as soon as I press Alt+Ctrl+A key on keyboard.How can I do it?Any help please.It's urgent.
Thank you.
|
|
|
|
|
Use event KeyDown :
private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if(e.KeyCode == Keys.A && (e.Control && e.Alt))
{
MessageBox.Show("Hello");
}
}
|
|
|
|
|
My exe is running in the background so ,it is not having focus .So this solution does not work .I need a solution in which even if my exe is running in the background ,captures the hotkey combination and does it,s prdicede task.
|
|
|
|
|
Try this (C++):
http://www.ragestorm.net/snippet?id=65
|
|
|
|
|
Can anyone help?
I have a service that’s set to interact with the current users desktop, the problem I have is I need to bring a window to front of any other window. While this works some times, in applications like Word the form does not display and is only shown in the Taskbar.
The window which is displayed by the service has the following set.
.topmost = true
.SetTopLevel = true
.Toplevel = true
And displayed using
MSCPrompt fForm = new MSCPrompt(cMessage);
fForm.ShowDialog();
Does anyone have any ideas why having set these options it still does not display on top of all other windows.
Paul
|
|
|
|
|
I tried it like this:
_instance.Show();
_instance.TopMost = true;
works!
Make shure that no other Form is set to TopMost.
All the best,
Martin
|
|
|
|
|
try .BringToFront()
Hope that works for you,
Regards,
Pramod
|
|
|
|
|
Yep, Tried this and does not work. I just can;t seem to fix this with the inbuild options of a form. may be i need to look at the Win32 API.
Cheers
|
|
|
|
|
hi,
I think i'm looking for a solution like the one you have done
May i've a look to your code?
NOthing by now;)
|
|
|
|
|
Hi All,
Am displaying icon in one of the column of the datagrid. The icon has got transperent background but while displaying on the grid it always takes white backgroud.
Can anyone help me out as how to retain the transperent background of the icon?
My Implementation Approach.
I have created a customised DataGridTextBoxColumn in which am overriding the paint method. The similar approach you will find on the net.
Any help is apprecicated.
Regards,
Kais
|
|
|
|
|
My English is very bad! I'm sorry! I am Vietname!
I want to Connect between Server and Client use Class Socket but i don't make it! Who're known? talk for me! Thankz
None Signature!
|
|
|
|
|
Use TcpClient. It is easier then Socket.
using System;
using System.Net.Sockets;
using System.Text;
using System.Threading;
namespace ConsoleApplication25
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Thread serverThread = new Thread(new ThreadStart(Server));
serverThread.Start();
Thread.Sleep(1000);
Thread clientThread = new Thread(new ThreadStart(Client));
clientThread.Start();
}
static void Server()
{
byte[] buffer = new byte[1000];
TcpListener tcpListener = new TcpListener(30000);
tcpListener.Start();
TcpClient tcpClient = tcpListener.AcceptTcpClient();
NetworkStream networkStream = tcpClient.GetStream();
networkStream.Read(buffer, 0, buffer.Length);
string stringReceived = Encoding.ASCII.GetString(buffer).Replace("\0", "");
Console.WriteLine("Server received : " + stringReceived);
}
static void Client()
{
string stringToSend = "Hello World";
byte[] buffer = Encoding.ASCII.GetBytes(stringToSend);
TcpClient tcpClient = new TcpClient();
tcpClient.Connect("localhost", 30000);
NetworkStream networkStream = tcpClient.GetStream();
Console.WriteLine("Client send : " + stringToSend);
networkStream.Write(buffer, 0, buffer.Length);
}
}
}
|
|
|
|
|
Hi all.
I have the following.
MainForm; Form1; Form2;
What I want to do is to take my MainForm, set it as MDIContainer. Then I want to spilt the screen in two using panels, left hand Form1 and on the right hand Form2.
I have no idea how to work with panels.
Any help will be apreciated
Thanks in advance
He who laughs last is a bit on the slow side
|
|
|
|
|
In this case it would be better, to take UserControls instead of Form1 and Form2.
1)MainForm creates the instances of panel1, panel2, UserControl1 and UserControl2.
2)Than place the panels at your Mainform.
Mainform.Controls.Add(panel1);
.....
3)place the Usercontrols in the panel you whant.
Mainform.panel1.Controls.Add(UserControl1);
4)In your case it could be possible to Use the 'Dock' Property of panel (Mainform.panel1.Dock = DockStyle.left;)
5)And 'Dock' for the UserControls as well (Mainform.UserControl1.Dock = DockStyle.Fill;)
Hope that helps you!
All the best,
Martin
|
|
|
|
|
Thanks.
I have no idea how controls work, will look into it.
still learning the language.
He who laughs last is a bit on the slow side
|
|
|
|
|
I'm putting on-line help into an application. What is the best way to compile a help file. I looked at Microsoft html help compiler, but it doesn't let me add word documents so I would need format everything into html. Ideally I just want to add my word documents. Thanks.
|
|
|
|
|
Couldn't you just save the Word document in html format and use that?
Glen Harvy
|
|
|
|
|
I think that will do the job, although I'm not sure if that will enable you to build an index and get hyperlinks in the help file...
WM.
What about weapons of mass-construction?
|
|
|
|
|
I want to develop a distributed architecture in .NET. The working of this architecture will be as follows:
Users will log in to the site, and voluntarily allow their Processor Cycles to be used, when ever it is free. For this the Users will have to download a component from the site, and this component will get installed in their PC.
This component will communicate with the Central component, which will distribute the tasks to the Users. This component will perform the assigned tasks, whenever, the User's processor cycles are free.
I have read about these architectures being implemented with VC++.
So I would like to know your comments regarding this, and how this architecture can be implemented in .NET(C#).
|
|
|
|