|
You could simply put a picturebox inside a form, with Docking set to DockStyle.Fill.
Set AutoScroll to true on the Form, and the scrollbars will appear.
That's it
Yes, even I am blogging now!
|
|
|
|
|
|
I have made the following property on a Custom Control (derived from ComboBox), but when I use it both in design time and in runtime, the value of the StringCollection is empty.
The 'set' part of the property alters the ComboBox' own ObjectCollection 'Items'.
I add strings to the property in design time, and the editor says that they are present, but when i use it the value inparameter to the property is empty - i.e. no strings in the StringCollection.
Any thoughts on why this is so?
[Editor("System.Windows.Forms.Design.StringCollectionEditor, System.Design",
typeof(System.Drawing.Design.UITypeEditor))]
public StringCollection ItemList
{
get
{
return this.itemList;
}
set
{
try
{
StringCollection arr = AgroSoftTranslator.TranslateItems(value);
((AComboBox)base.aControl).Items.Clear();
foreach(string s in arr)
{
((AComboBox)base.aControl).Items.Add(s);
}
base.aControl.Invalidate();
this.itemList = value;
}
catch(Exception e)
{
throw e;
}
}
}//property itemList
|
|
|
|
|
Hey!
I wanna know how can i POST an IMAGE with HttpWebRequest.
I know how to post fields etc, but IMAGE... :\
Any article? tutorial?
Thanks.
|
|
|
|
|
AFAIK, you can post binary data to any page, as long as the server application knows how to read it. Simply set the Content-Length header appropriately, and send the binary data.
Other way would be sending it as a text field, base64 encoded.
Yes, even I am blogging now!
|
|
|
|
|
hi all
Reasons given by all of u are correct but i have some more reasons.
So days ago, i have a problem in inserting data into the table of SQL Server through C#. I tried it many times, posted it on another forum ( not cp ). after many hours , i got the response, and the problem was that i was missing only a comma in the string. This was a very short problem, had it been corrected quickly, it may have taken me only five minutes to complete my task, which otherwise took many hours. Many times such things happen. For this type of things i am asking for some kind persons to add me.
For longer problem , i agree that they must be posted on the CP so that other people can also be benefited by them. And there must be many possible solutions that come as a output for that big problem. But for small problems like the one mentioned above, i donot think that there are many solutions for that, and if it takes hours to solve problem like mentioned in above para, then i think its better to leave the software engg and start so other work.
As for as the point that no one can help other instananiously, because no one is free..... i will only say that if a person can come to cp and spend his hours to answer the queries, then that person can also spend seconds to answer questions like described in first para, ask from them on the messenger.
Now i think that, if there are some kind persons available there in this forum, then they will surely add me to their messenger list in order to solve the short problem of their younger brother....
Looking for very much health response...
giki_guy@hotmail.com
|
|
|
|
|
All the effort you're doing trying to convince us to give you help on the way you want, you could have posted 2 real questions and had your answers.
Here in Brazil we have this saying "If someone gives you a horse, don't look at its teeth."
Yes, even I am blogging now!
|
|
|
|
|
yeah you are correct in saying that i have made so much effort. But if i found even a single guy, while can solve couple of my problems quickly.... Then i think i will get more benfit of time than that which i lost here in convincing people....
Now it is humbly requested to please help me..... Donot Waste ur timing in convincing me, rather give me ur healthy response....
|
|
|
|
|
In the past I made the mistake of giving my msngr to the odd person looking for some quick help, I call it a mistake because helping people in this manner once or twice is not a problem but when those people start asking incessantly for help it becomes rather tiresome. I have even had people getting a bit nasty because I was unable to help or did not have time at that moment. I would advise nobody offer help in this manner it is counter-productive for helper and helpee.
Quite frankly, Your problem was a _VERY_ simple syntax error, and if you needed somebody to point it out then you have not yet grasped enough about programming and you will need to read books/web articles etc to expand your knowledge. It can be frustrating, especially syntax errors - as you need a certain level of understanding in order to start figuring them out - this comes with time and experience unfortunately... not in the shape of a helping hand on messenger! What im getting at is that figuring it out for yourself will teach you 100x more than somebody doing it for you.
You will not be ridiculed if you post a simple syntax error question on CP, so long as you provide:
1) The offending code in a concise manner (ie not a copy/paste of the entire form/class/module)
2) The error message
3) The steps you have taken to try to figure the problem out (ie I tried commenting out 'xyz' to see if that was causing the problem).
|
|
|
|
|
|
Ok....
if no body want to help me.... I will not force to any body....
But one thing to say is that i cann't post small errors to CP, because it is so much slow in response.....
and i cann't understand the sentence " In your quest for high-quality, 24x7, instant, free professional help " , what do u mean by that???
|
|
|
|
|
I think what he's getting at is that we programmers are happy to help, however we charge for consultancy.
What you are asking for is somewhere between a teacher and a consultant. Both these professions are chargeable by the hour. On the other hand, message boards are free - make your decision.
This is no different to DIY jobs for me. If I can wait a bit, I can get it done free as I just have to find some time to do it myself. If I want it NOW, or I lack the required skill, then I pay a man to do it for me.
|
|
|
|
|
Daniel Turini wrote:
"If someone gives you a horse, don't look at its teeth."
Here in Czech Rep we have the same saying maybe cuz it's roman, isn't it?
Horatio or Seneca or ... ?
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
About adding to messenger for instant help...
Lets say there are two types of problems:
1. Problems that you have tried to solve with all your abilities. And maybe asked your co-worker.
This is the proper time to ask for help at CP or other resouce.
2. Problems that you give up on after a few minutes.
I believe this is a very destructive habit. You should never give up on any problem. I recomend sharpening your searching skills, buying books on subjects you don't clearly understand, read MSDN regularly , read newsgroups... This is what is actually going to get you much more than instant messenger help.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi i am trying to move a child windows within an mdi window
i have a control on the child that when clicked it allows me to drag the child around
however the child is actualy offset a whole lot below and to the right
i do not know how to get the window to move to my mouse position within the parent form
i think the problem has to do with the mouse coords being from the child form and not the parents coordinates how do i move the child window to exactly where my mouse pointer is?
if(dragging)
{
this.Location = MousePosition;
}
ive tried everything subtratcing and adding the forms original positon
PointToScreen and ScreenToClient
can someone please help me!
|
|
|
|
|
when the mouse is clicked on the child window, it is not clicked in the upper lefthand corner, it's offset by some (x, y), record that offset when the mouse is clicked, and add it the mouse position when you do the move
mouseclick (x, y) {
mouseoffet = point (x, y);
}
mousemouse () {
if(dragging)
{
this.Location = MousePosition + mouseoffset;
}
you're losing that offset.
|
|
|
|
|
when the mouse is clicked on the child window, it is not clicked in the upper lefthand corner, it's offset by some (x, y), record that offset when the mouse is clicked, and add it the mouse position when you do the move
mouseclick {
mouseoffset = MousePosition - this.Location;
}
mousemouse () {
if(dragging)
{
this.Location = MousePosition + mouseoffset;
}
you're losing that offset.
|
|
|
|
|
Try the following:
if(dragging)
{
this.Location = parentform.ScreenToClient(Cursor.Position);
}
www.troschuetz.de
|
|
|
|
|
I created my first C# application. When the application runs, the user can drag the bottom-right corner to resize it.
Is there a property that I can turn that option off?
|
|
|
|
|
yes change the form border style
|
|
|
|
|
Hello
I am want to query a database in my book table. I want to find all the books that are over due. This is the query below, but when l execute it, it returns no records. I think it is because of the datatype. I am using MS Access in the datadue field l have it set as a DateTime datatype.
I am using C#
DateTime today = Convert.ToDateTime(DateTime.Today.ToShortDateString());
string queryOverdueBooks = @"SELECT RefNumber, Title, DateOut, DateDue FROM Book WHERE DateDue < '" + today + "' ";
Does anyone know how to correct this query so that it will return the books that are overdue.
Many thanks in advance,
Steve
|
|
|
|
|
Try using some function which is equivalent of To_Date function of oracle.
string queryOverdueBooks = @"SELECT RefNumber, Title, DateOut, DateDue FROM Book WHERE DateDue < To_date('" + today + "' " + ", yyyy/mm/dd");
|
|
|
|
|
just checked the access syntax. the below should also do.
DateTime today = Convert.ToDateTime(DateTime.Today.ToShortDateString());
string queryOverdueBooks = @"SELECT RefNumber, Title, DateOut, DateDue FROM Book WHERE DateDue < " + today + ";
Another solution:
DateTime today = Convert.ToDateTime(DateTime.Today.ToShortDateString());
string queryOverdueBooks = @"SELECT RefNumber, Title, DateOut, DateDue FROM Book WHERE DateDue < Format(" + "'" + today + "', 'YYYY/MM/DD') ";
Do reply whether it could solve your problem or not.
|
|
|
|
|
Here's my code, designed to query a definition from dict.org (ironically, there are only a handful of Windows programs out there that do that):
**************************
IPHostEntry IPAdd = Dns.Resolve("dict.org");
IPEndPoint IPEP = new IPEndPoint(IPAdd.AddressList[0], 2628);
Socket s = new Socket(IPEP.Address.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
string str = "DEFINE * " + Convert.ToChar(034) + SelectedWord + Convert.ToChar(034) + Convert.ToChar(013) + Convert.ToChar(10);
Byte[] Sender = System.Text.Encoding.ASCII.GetBytes(str);
Byte[] Receiver = new Byte[20000];
s.Connect(IPEP);
Int32 bytes = s.Receive(Receiver, Receiver.Length, 0);
s.Send(Sender, Sender.Length, 0);
bytes = s.Receive(Receiver, Receiver.Length, 0);
strDefinition = System.Text.Encoding.ASCII.GetString(Receiver, 0, bytes);
************************
My problem is, every so often I get a response that is so long it overflows my Receiver array (ever look up "at" in the dictionary? ). Declaring a 1,000,000 member array seems a bit silly, so is there a way to declare a dynamic Byte array that can be added to like an ArrayList? Or maybe some other workaround for this algorithm?
|
|
|
|
|
tantiboh wrote:
My problem is, every so often I get a response that is so long it overflows my Receiver array (ever look up "at" in the dictionary? ). Declaring a 1,000,000 member array seems a bit silly, so is there a way to declare a dynamic Byte array that can be added to like an ArrayList? Or maybe some other workaround for this algorithm?
Something like this:
StringBuilder sb = new StringBuilder();
while ((bytes = s.Receive(Receiver, Receiver.Length, 0)) != 0)
{
sb.Append(System.Text.Encoding.ASCII.GetString(Receiver, 0, bytes));
}
strDefinition = sb.ToString();
Yes, even I am blogging now!
|
|
|
|
|