|
PIEBALDconsult wrote: the Designer wanted to design the first class in the file
Yeah I think that restriction got relaxed, it does not get at me anymore, maybe they
solved it, maybe I don't even try it anymore.
PIEBALDconsult wrote: Maybe in the additional files you could add some class simply to have that attribute?
in my limited experiments it either ignores the additions, or it complains about
inconsistency. So any input will be appreciated.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I tried it, VS just gives a better message explaining the situation.
|
|
|
|
|
You can also make code view the default and open the designer only when you use "right-click|view designer".
Right-click a Control/Form file and choose "Open with", then choose "CSharp Editor" and click "Set as Default".
|
|
|
|
|
hi
Does http channel supports bidirection connection over the internet?
Actually i need to trigger some events at the client application resides behind firewall/proxy/NAT network from the server running at public IP out side my network.
naresh is testing the site.
|
|
|
|
|
dhami_naresh wrote: Actually i need to trigger some events at the client
HTTP[^] does not support that.
|
|
|
|
|
Thank you very much Led Mike,
Actually i am using http channel of dot net remoting. Client can connect to server(server in out side my network) channel via this http channel implementation in .net remoting and can send data to server but we need to trigger some events from server to client via this channel. So the problem is server cant send any type of message to the client.
So please may be some addons those could help on solving this problems or may be some sample application those are teaching the same things. Please if you know, send me those references.
thank you in advance.
naresh is testing the site.
|
|
|
|
|
HTTP is a protocol that is used over TCP/IP. It does not support what you describe. Perhaps using another IPC mechanism would provide you with a solution. Have you looked into Message Queues? Or even creating a proprietary protocol using Sockets?
|
|
|
|
|
thank you again Mike,
i search out those thing what you suggested.
thank you verch much.
naresh is testing the site.
|
|
|
|
|
Hi Guys,
I have added a basic logon form that gets a users logon name and password and matches that to a given list to my project. Once it has been validated it calls the main form. Now, the problem I have is that when it calls the main form I can't connect to the db. The user validation is done in the logon form class as you can see below.
private void button1_Click(object sender, EventArgs e)
{
frmNef frm1 = new frmNef();
if (textBox1.Text == "maphanga" && textBox2.Text == "marsha" || textBox1.Text == "nkosi" && textBox2.Text == "mdu" || textBox1.Text == "carrim" && textBox2.Text == "allerece" || textBox1.Text == "raphela" && textBox2.Text == "rachel" || textBox1.Text == "mazibuko" && textBox2.Text == "zoliswa")
{
this.DialogResult = DialogResult.OK;
}
else MessageBox.Show("Invalid Username and or Password supplied");
}
This is then validated in the main form's load event.
private void frmNef_Load(object sender, EventArgs e)
{
Login login = new Login();
if (login.ShowDialog(this) == DialogResult.OK)
{
return;
}
else this.Close();
login.Close();
login.Dispose();
Can somebody please tell me how I can do this better so as to get the connection to the DB working properly with the logon form? I had to remove the logon form before the app would work again.
Thanking you in advance.
|
|
|
|
|
Kwagga wrote: I can't connect to the db.
Yeah it requires some code or something to do that. Your posted code contains nothing that connects to a database. There are a large number of articles here on CodeProject about Database development using C#. Perhaps you might look at them.
|
|
|
|
|
Sorry mate. The db connection works fine when I remove the logon form code. When I add the logon form code in I can't see anything in the DB, nor can I save anything back in. It is almost as if the logon form is not releasing focus to the main form. However it opens the main form OK but I guess it might be that it loops somewhere or doing something silly like that which I just can't seem to figure out.
Anyway, here is more code from the main form.
Login login = new Login();
if (login.ShowDialog() == DialogResult.OK)
{
return;
}
else this.Close();
login.Close();
login.Dispose();
try
{
DateTime dtCurrentTime = DateTime.Now;
tlstrlblTime.Text = dtCurrentTime.ToShortTimeString();
DateTime dtCurrentDate = DateTime.Today;
tlstrlblDate.Text = dtCurrentDate.ToShortDateString();
m_cnADONetConnection.ConnectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\CallCentre.mdb";
m_cnADONetConnection.Open();
m_daDataAdapter =
new OleDbDataAdapter("Select * From [CallCentre]", m_cnADONetConnection);
OleDbCommandBuilder m_cbCommandbuilder =
new OleDbCommandBuilder(m_daDataAdapter);
m_daDataAdapter.Fill(m_dtCallCentre);
this.ShowCurrentRecord();
If you can point me to some of the posts I would greatly appreciate it. I have been searching here and on Google but none of the topics i find actauly refers to what I'm doing. Most of them are for web development.
|
|
|
|
|
Kwagga wrote: if (login.ShowDialog() == DialogResult.OK)
{
return;
}
|
|
|
|
|
Thanks mate but what about the "return"? I don't understand what you trying to say.
|
|
|
|
|
He is saying that the return statement you have is dropping you out of the procedure. Because of it, you aren't ever getting to the try block...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Thanks Paul. I will try and change this. However, strange thing is that it works fine in another project of mines where I use a .MDF as database. I will and modify this one and see what happens.
|
|
|
|
|
Guys, just so you know, I sorted this out. Instead of using "return" i used " this.Show();. Not sure if this is the correct thing to do but it seems to be working fine.
Thanks so much of the assistance from both of you.
Cheers
B
|
|
|
|
|
Cool deal, glad it seems to be working
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
Hi, I have a simple blackjack game I am toying with and I need to count the amount of times the player has pressed the "Deal" button. Any suggestions ?
Thanks
|
|
|
|
|
|
More specifically, it is an aspx application and I need a way to capture the callback in a variable or by using IsCallBack to keep track of postbacks. Any help ????
|
|
|
|
|
Okay, final thing (for now) on graphics. How do you move what you draw? Does it involve the right or top , etc? I tried
rectangle1.Location = new System.Drawing.Point(x, y);
, but it didn't work. (x/y being someplace not important)
And, this is in a swich event for the arrow keys, just to let anyone who's curious to know.
Thanks in advance
|
|
|
|
|
Hi, I have a standard answer to painting questions, here it is:
there are several steps to draw something so it becomes visible on the screen:
1.
decide on what object you want to draw; it normally is a Control (e.g. a Panel) or a
Form itself. I prefer to add a Panel to a Form, then draw on the Panel.
2.
create some variables (Rectangle, struct, class, whatever) that hold the parameters of
your drawing. For a rectangle that could be top and left coordinate, and width+height,
or just a Rectangle object. etc.
3.
create a Paint handler for that Panel, and do all your drawing in there, using the
Graphics class and your variables.
4.
when you want to move things, modify the variables and call Panel.Invalidate() or
one of its overloads (for selective invalidation).
5.
If you want to animate things, perform the move (step 4) inside the Tick handler
of a Windows.Forms.Timer
BTW: if you need to create some objects (Fonts, Pens, Brushes, ...) either keep them
alive in class members (hence create them only once); or create them inside the Paint
handler and don't forget to call Dispose() on them.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Please give me an example of Panel.Invalidate(). Thanks though, I honestly see what you are getting at.
|
|
|
|
|
MasterSharp wrote: Please give me an example of Panel.Invalidate().
They hide those in the documentation[^]
|
|
|
|
|
MasterSharp wrote: Please give me an example of Panel.Invalidate().
if you have a Panel myPanel on which you draw some shape myShape and
want to move the shape, then do something along these lines:
myShape.X=myShape.X+100;
myPanel.Invalidate();
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|