|
Well, think about what's on a contract. Just the first little section, purchaser's Last Name, First Name, Address 1, Address 2, City, State, Zip-Code, Home Phone, Work Phone, Cell Phone is 10 textbox controls. Plus, this is taking the place of a very old Access application and the end users are very adament about it looking exactly like what they currently have.
|
|
|
|
|
FyreWyrm wrote: Just the first little section, purchaser's Last Name, First Name, Address 1, Address 2, City, State, Zip-Code, Home Phone, Work Phone, Cell Phone is 10 textbox controls.
Or 1 PropertyGrid control. You can edit almost any data using a single PropertyGrid control. Furthermore you can use things like trees etc., to navigate the hierarchy of your data and at each navigation point you can edit that subset of the data in the same PropertyGrid control. Do you use Visual Studio? Did you not notice how the same control provides editing for all the data in your project?
led mike
|
|
|
|
|
Sorry, I don't know anything about PropertyGrid s. This is the first Windows app ever developed by my company (and it's for internal use only). Furthermore, this is the first coding project I've been involved with. Up until now my career as a "programmer" (programmer in title only) has been limited to writing documentation for old web apps. But I'm enjoying my freedom with this one. I'm learning a lot.
|
|
|
|
|
A code-saving technique that few developers seem to be aware of is that you can wire multiple events to a single event handler. You can make each control's Changed event call the same function.
Visual Studio's designers don't make this very easy, but you can enter the same function name in the Events part of the Properties pane for each control.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
I've played around with this approach some and it's driving me up the wall. Apparently, the TextChanged event fires for a control when you programmatically change the text also. So when the form loads and I clear all the fields, the event fires for each field there. Then when I display a record, the event fires for each field there. Is there any way to suspend the firing of events on a form (like the suspend layout functions) while I manipulate the fields in the code? That would prevent unnecessary firing of this event. Thanks for your help.
|
|
|
|
|
You could unbind all events and rebind them afterwards but that isn't very good. Just set a flag (private boolean member) before you fill all your controls. In the changed event just check if the flag is set and do nothing if it is. After you have updated all controls just reset the flag:
private bool _inFill;
public void Fill(SomeClass data)
{
try
{
_inFill = true;
} finally
{
_inFill = false;
}
}
private void AllControlsChangedEventHandler(object sender, EventArgs e)
{
if (_inFill)
return;
}
|
|
|
|
|
FyreWyrm - the approach we take is to have our business objects implement the INotifyPropertyChanged interface.
public class Customer : INotifyPropertyChanged
{
private int _id = 0;
private string _customerName = string.Empty;
public event PropertyChangedEventHandler PropertyChanged = new delegate { };
private void PropertyChanged(string value)
{
PropertyChanged(this, new PropertyChangedEventArgs(value));
}
public string CustomerName
{
get { return _customerName; }
set
{
if (value != _customerName)
{
_customerName = value;
PropertyChanged("CustomerName");
}
}
}
} Any change to CustomerName will result in a property changed notification being raised. If you take a look into databinding (Link[^]), then you should find you can gain a real headstart.
|
|
|
|
|
Wow, thanks for the info Pete. I think this is the way we will end up going.
|
|
|
|
|
No problem mate. It also makes leaping into WPF a lot easier.
|
|
|
|
|
Pete, this is sort of working and sort of isn't. Tracking the changes is working, but something strange is happening with my objects. This form has a collection of records and only displays one record at a time allowing users to navigate through records. Any time fields are changed on the displayed record, the changes are translated automatically back up into the collection. Here's an example:
class Form
{
private Objects _objects = new Objects();
private Object _object = new Object();
private int _index = 0;
<p></p>
private void Form_Load(blah)
{
_objects = GetAllObjects();
_object = _objects[_index];
formBindingSource.DataSource = _object;
}
<p></p>
private void NextButton_Click(blah)
{
_index++;
_object = _objects[_index];
formBindingSource.DataSource = _object;
}
}
When the user then changes any field on the screen, I see the setter called for that property (which is good). Then in the event handler for the "Next Record" button I can look at the collection, and all of their changes to the current object have been written back into the collection. I don't even have any code to set the object back into the collection! It's like when the databinding link is made my _object becomes a pointer to _objects[0] instead of a copy of _objects[0] . Any ideas?
|
|
|
|
|
I'd have to see the classes to tell. Could you split your code out into a test project and then send it to me to have a look at? Email me from the link on this message and I'll send a reply so you know where to send the code to.
|
|
|
|
|
Alright so I have an FTP for my website and a baseball coach asked if I could make it so he could log on to my FTP and upload the stats page of the team so i don't have to do it myself.
I had a few questions regarding this:
- Is it possible to password protect a folder and give him access to only that?
- I have don't have too much programming knowledge compared to alot of you, so is it possible a application could be made in say, C# that will allow him to log on to the application and select a file and hit upload?
- any other suggestions?
thanks for your time,
Kevin
|
|
|
|
|
Most FTP Servers allow the administrator to setup accounts. This would require users to supply login/password information to upload/download files. Try the documentation for the FTP Server you are using.
led mike
|
|
|
|
|
hi guys
i amm currently writing an application in windows forms. i want the application to send and recieve messages to and from the google talk server. like instant messages. the idea is to use these messages as commands.
my problem is that i dont know how to connect to the server and how to send and recieve the messages.
any help will be appreciated.
please keep it basic if possible. i am a beginner.
thanks in advance.
JJ
|
|
|
|
|
joachimpr wrote: please keep it basic if possible. i am a beginner.
And what if it isn't possible? There are potentially hundreds of things most of which are not basic (whatever that means).
joachimpr wrote: my problem is that i dont know how to connect to the server and how to send and recieve the messages.
Yes and trying to find out hundreds of things using a Web forum will result in hundreds of messages before you can complete your project. Does that sound like a good idea?
This is why beginner programs are like HelloWorld.exe and then one gradually works up from there. Did I say "gradually"?
led mike
|
|
|
|
|
you did say gradually (whatever that is).
and if it isnt possible then its fine. that is why i said "if possible"...
i can figure it out.
i just need a direction to go in...
(and as for the hundreds of messages, its fine because hopefully out of those hundreds of posts i can actully find a lollution. i have treid everything else...)
thank you so much.
|
|
|
|
|
joachimpr wrote: my problem is that i dont know how to connect to the server and how to send and recieve the messages.
Did you take a look at the Google Talk Developer Documentation[^]?
Perhaps if you have specific questions referencing the documentation we might make some progress.
led mike
|
|
|
|
|
I have taken a look at the google documentation. It didnt help much. I have done quite a bit of research on this topic.
ok, that question would be, can you actually initiate a xmpp connection from behind a firewall?
i have found an article on codeproject that shows you ho to create a simple jabber client but i cant seem to get it to authenticate me. it keeps returning false.
and if someone can tell me how to create an account on the jabber80.com server that would be extremely helpfull. the website www.jabber80.com doesnt provide any interface to do that.
thank you.
|
|
|
|
|
joachimpr wrote: I have taken a look at the google documentation. It didnt help much. I have done quite a bit of research on this topic.
ok, that question would be, can you actually initiate a xmpp connection from behind a firewall?
Ok, don't take this the wrong way but I know nothing about XMPP. However using key words from your post "xmpp connection firewall" in a Google search I quickly found that the default port is 5222 which of course will not work behind a typical firewall that only allows port 80. However that information is in a document on the XMPP web site for a HTTP solution.[^]
The Google results also seem to find some 3rd party libraries and perhaps much other useful information. So when you said you have done quite a bit of research, I spent like 5 minutes. Again I am not trying to be mean but I am pointing out how important finding and reading documentation is to the activities of a software developer.
led mike
|
|
|
|
|
Ya that is fine. No worries mate. Every experience is a learning experience. And I know that xmpp works on either port 5222 or 5223 and as you said it cannot work from behind a basic firewall yet I can use my gtalk client just fine which functions on port 5222, and I checked but the client that I am trying to get to function doesn’t work…
I found a website that can be usefull: www.jabber80.com. This enables you to use port 80 but you have to create an account on the jabber80.com server and I have no idée how to do that. The site doesn’t provide for that.
Is there any other way that I can send messages from my application to my chat client on my mobile? Maybe without using xmpp?
I am sorry, I know I ask a lot of stupid questions. But ill rather ask and learn.
Thanks led mike!
|
|
|
|
|
Hey Buddy!
What exactly is the scope of what your trying to do? do your "Commands" have to go to a remote(over the internet) PC or just over a network?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
It has to go over remote.
In other words(or graphically illustrated):
Client1(My PC at work where the application is running) ? Server(google containing my gtalk profile ? Client2(My mobile phone containing my mxit client)
So in essence it should function as such:
- I send an instant message from client2 containing a command eg. Open windows media player.
- the server receives the message and sends it to client1
- client1 receives the message and executes the command(Open windows media player)
- client1 sends a response (instant message saying “opened windows media player”) back to the server.
- the server then receives the response and sends it back to client1.
Then I can read the message.
And BOOM!!! You’ve got yourself a remote controllable application!
Any help?
|
|
|
|
|
cool, then your on the right track...
you will how ever need to read the documentation bud. i haven't worked with google talk... YET
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
Dear sir iam developing one windows application,
when i build the application the build was successful.
but i got 2 warnings. i copy the warnings here.
1.Warning 1 The file 'imgs\start_resume_recording_normal.png' could not be added to the project. A file with the same path already exists in the project. Video E-Mail
2.Warning 2 The file 'imgs\stop_resume_recording_normal.png' could not be added to the project. A file with the same path already exists in the project. Video E-Mail
i go to images folder in the video E-Mail project n i chk the images,if i delete these 2 images. build was unsucceeded.
it is showing an error: "start_resume_recording_normal.png" , "stop_resume_recording_normal.png'" could not found the
image.
please help me sir.
|
|
|
|
|
Hi all,
I have two Text boxes..But i need Should not copy-paste in textbox into another textbox in C#.Net... So pls Help me....
Regards
Somasundaram G
|
|
|
|