|
if you don't want to allow the form to be resized you can set the MaximumSize and MinimumSize properties of the form so it will keep the current size.
if you already set the size of your form you can do this:
yourForm.MaximumSize = yourForm.Size;
yourForm.MinimumSize = yourForm.Size;
then it can't be resized even if the restore button isn't disabled
Here we rest... So why not make the best of it?
|
|
|
|
|
But i'm loading another application (word office, eg.) into that form. So, when i resize the "inside" application, it also resizes the outside form too despite you fixing size of the outside form. I suppose that we must use some API functions to solve but i don't know exactly.
|
|
|
|
|
If you're using C#, then why on earth would you do this ? That's just insane. You can disallow all these buttons in the properties dialog for the form, including the the restore box.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You can fix size of the outside form, but when i resize inside application (eg. Word Office window) then the outside form is also changed despite it being fixed.
|
|
|
|
|
i really don't know the term to look for. what i would like to accomplish is a way to create an object using new and a string representing the type of the object. i intend to obtain the value of the string from an xml entry.
muchos gracias
----------------------------------------------------------
Lorem ipsum dolor sit amet.
|
|
|
|
|
|
I have this little code I wrote:
(and with the help from some nice persons from this forum.)
using System;
using System.Windows.Forms;
using System.IO.Ports;
namespace serialport
{
public partial class Form1 : Form
{
private SerialPort port = new SerialPort("COM3", 9600, Parity.Odd, 8, StopBits.One);
public Form1()
{
InitializeComponent(); port.Open();
}
private void buttonSS_Click(object sender, EventArgs e)
{
timer1.Enabled = !timer1.Enabled;
}
private void timer1_Tick(object sender, EventArgs e)
{
port.DtrEnable = !port.DtrEnable;
if (port.DtrEnable)
{
timer1.Interval = (int)numericUpDown1.Value;
}
else
{
timer1.Interval = (int)numericUpDown2.Value;
}
}
Now, What I want is a little complicated because I want to store the values from inside timer1_Tick event handrler into some sort of container. I want to make 10 (or more) containers that can hold different values I choose from those timer.intervals(or numUpDown). Then, to be able to play them in order, one container after another. When first container finish its doings, then the second container with his custom values enter and start to run, then the third,etc.
Thanks
~Teodor~
modified on Monday, November 2, 2009 1:34 PM
|
|
|
|
|
Hey Please help me, I got following error while going to make new directory and then upload files in it on FTP.
Error
The remote server returned an error: (550) File unavailable (e.g., file not found, no access)
My code
if (!WebRequestMethods.Ftp.ListDirectoryDetails.Contains("FTPPath" + strdate.ToString()))
{
FtpWebRequest reqObjs = (FtpWebRequest)FtpWebRequest.Create("FTPPath" + strdate.ToString());
reqObjs.Credentials = new NetworkCredential(UName, PWD);
reqObjs.Method = WebRequestMethods.Ftp.MakeDirectory;
}
string CompleteFTPPath = "FTPPath" + strdate.ToString() + "/" + Convert.ToString(ViewState["FileName"]);
string CompleteLocalPath = ConfigurationSettings.AppSettings["OutputPDFFilePath"].ToString() + "\\" + strdate.ToString() + "\\" + Convert.ToString(ViewState["FileName"]);
FtpWebRequest reqObj = (FtpWebRequest)WebRequest.Create(CompleteFTPPath);
reqObj.Method = WebRequestMethods.Ftp.UploadFile;
reqObj.Credentials = new NetworkCredential(UName, PWD);
reqObj.Proxy = null;
Stream requestStream = reqObj.GetRequestStream();
FileStream streamObj = File.OpenRead(CompleteLocalPath);
byte[] buffer = new Byte[streamObj.Length];
streamObj.Read(buffer, 0, buffer.Length);
streamObj.Close();
requestStream.Write(buffer, 0, buffer.Length);
requestStream.Close();
modified on Monday, November 2, 2009 7:58 AM
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:23am.
|
|
|
|
|
CompletePath is "ftp://" + FTPPath + "//" + TodaysDate + "//"
Same local path = ConfigurationSettings.AppSettings["OutputPDFFilePath"].ToString() + "\\" + strdate.ToString() + "\\" + Convert.ToString(ViewState["FileName"]);
|
|
|
|
|
I would say either you filepath is wrong (file not found)
or you don't have permission to write to that file (no access)
do you have the correct access? try a manual upload (with IExplorer or something) see if you can overwrite the same file you are trying to do via code
I believe when you attempt to create a file with WebRequest.Create and the directory does not exists then that will throw an error too.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Where to begin?
- Putting Urgent is not going to help, it isn't to us.
- The source code is not in <pre> tags and is therefore hard to read.
- The error message you give only has a few causes (which can be easily googled, and are given in the error description) ie The file doesn't exist, The Path is not correct or the user which is performing the ftp does not have access rights.
- You have not told us which (if any) of the above errors you have tried to resolve.
Please read the stickies on how to get an answer to your questiong at the top of the message board.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
take the 2X4 outta ur arse
|
|
|
|
|
i have installed a dotnet apps few months back in my machine. but now it is not running properly. so when i try to uninstall the apps then i am getting a fatal error. so please give me a suggestion how could i forcefully uninstall this apps from my machine.
thanks
tbhattacharjee
|
|
|
|
|
Hi all......
I need helping about...
How can i dump the contents of the DATAGRAME ( IP packet ) including the datagrame header and TCP headre????????????
I think you don't mind help me.........
|
|
|
|
|
Hi All,
I develop a system which work properly on serial ports device but i need to change the serial port cables to a usb. Is there any libraries for usb in .net.
Thanks
Liya.
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:23am.
|
|
|
|
|
|
Hi,
I have developed a application which is simulates a pdf reader. It has basic features like text select, hand tool, text search and so on.
There is a perfromance issue, which I have to fix. Following are the details of the issue.
When I open a pdf file and select the HAND tool, and scroll, there is flickering on the screen. I would like to make the scrolling as smooth as possible. like in Adobe acrobat.
How can I do that?
Any suggestion is appreciated.
Thank you,
|
|
|
|
|
Hi.
I'm creating a small program that can take restaurant menu choices. I have a main form that takes all the user's choices and then another form that takes how many did the user ordered for a particular dish/menu. Now my problem is I can't show the quantity inputted by the user to the main form where i can also show all the menu/dishes that the user has ordered, the quantity of each dish, and the total amount he must pay.
I have a class that gets the quantity but when i try to show it to the main form after entering the quantity, the value is still zero.
How will I show the quantity to the main form after i enter it from another form? I'm thinking of another way but I feel that this solution is possible.
this is the combobox from the main form:
OrderInfo customerChoices = new OrderInfo();
#region Appetizer ComboBox
private void cmboBoxAppetizer_SelectedIndexChanged(object sender, EventArgs e)
{
switch (cmboBoxAppetizer.SelectedIndex)
{
case 0:
{
frmQuantity frmQuantity = new frmQuantity();
frmQuantity.Show();
customerChoices.Appetizer = cmboBoxAppetizer.Text;
label1.Text = customerChoices.Quantity
}
break;
case 1:
{
frmQuantity frmQuantity = new frmQuantity();
frmQuantity.Show();
}
break;
case 2:
{
frmQuantity frmQuantity = new frmQuantity();
frmQuantity.Show();
}
break;
default:
{
}
break;
}
}
#endregion
then this is the form that takes the quantity:
public partial class frmQuantity : Form
{
OrderInfo customerChoices = new OrderInfo();
public frmQuantity()
{
InitializeComponent();
}
private void txtBoxQuantity_TextChanged(object sender, EventArgs e)
{
txtBoxQuantity.MaxLength = Convert.ToInt32(txtBoxQuantity.Text);
}
private void btnOk_Click(object sender, EventArgs e)
{
customerChoices.Quantity = Convert.ToInt32(txtBoxQuantity.Text);
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
}
and the class that takes the quantity:
class OrderInfo
{
int quantity;
public int Quantity
{
get
{
return quantity;
}
set
{
quantity = value;
}
}
}
I didn't include the other code to easily get what i want.
|
|
|
|
|
gamer1127 wrote: OrderInfo customerChoices = new OrderInfo();
You need to read a basic book on OO. Imagine you own two cars. Imagine you put a good stereo in one. Now, you're driving the other one. Do you have a good stereo ? Perhaps, but perhaps not. You have two different instances of OrderInfo, you set values in one, and the other is unaffected. You should use delegates to create communication between forms. Just google for articles explaining how delegates work, and go from there.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Ok. I have a book that explains how delegates work but it seems that the explanation is insufficient for me. I think I really need to buy more books for OO.
|
|
|
|
|
hi
i read file its extention cs
and i read it line by line
i want to knwo if this line is a header of method or not
how can i know if this line is a header of method or just a line of code
i try with this but not valid
private bool validLine(string s)
{
string[] spliter = s.Split('(');
string check = spliter[0];
string check2=check.Replace(" ","");
if (check2.StartsWith("if")
||check2.StartsWith("//")
||check2.StartsWith("for")
||check2.StartsWith("foreach")
||check2=="using"
|| s.StartsWith("if")
||s.StartsWith("///")
||s.StartsWith("for")
||s.StartsWith("using")
||s.StartsWith("foreach")
|| s.EndsWith(";")
|| s.EndsWith("}")
|| s.EndsWith("{")
|| !s.EndsWith(")")
||string.IsNullOrEmpty(s))
return false;
else
return true;
}
but i think this is not cover all cases
|
|
|
|
|
Yes, you do need help. What are you trying to do ? Your approach is both wrong and ugly. A method is going to be in the scope of a class. Anything inside {} is inside a method, once you're past the class scope. That's how I'd work it out, as well as looking for optional specifiers such as private, a method name, brackets and variable names inside ( plus no semicolon at the end ).
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You certain do, you need to learn to read the guidlines[^] of the forum.
You need to learn how to format your code using the pre (under CODE BLOCK)
zez0 wrote: knwo if this line is a header of method or not
Your question does not make a lot of sense, what do you mean by this.
[edit] spelling is worse than usual today [edit]
Never underestimate the power of human stupidity
RAH
|
|
|
|