|
Unless the application allows you do that, pop up a message asking the user to resize the window.
|
|
|
|
|
Hi,
Assuming:
1. you can identify the window by its handle
2. the window is resizable
3. you're not afraid of a little P/Invoke
you can use SetWindowPos (with option SWP_NOMOVE = 0x0002 and SWP_NOZORDER = 0x0004) to resize the window.
[DllImport("user32.dll", EntryPoint="SetWindowPos", CallingConvention=CallingConvention.StdCall)]
public static extern uint SetWindowPos(IntPtr Hdc, IntPtr hWndInsertAfter,
int X, int Y, int cx, int cy, uint flags);
modified on Friday, December 18, 2009 6:44 AM
|
|
|
|
|
جهت مشاهده و نحوه دریافت این کامپوننت میتوانید به سایت من رجوع کنید
www.ggsoft.ir
Welcome Mohsen Sabzaliyan
|
|
|
|
|
Huh?
So what is this? Unreadable advertising?
|
|
|
|
|
"Extended views and the like دریافت این کامپوننت میتوانید strona of the return of the کنید", although I'm not sure what that means.
/ravi
|
|
|
|
|
Topic is "Lunisolar calendar function and for the Farsi speaking world deaths"
the text in the message is "To view this component and how can I see the site"
I have no idea myself.
|
|
|
|
|
This site is aimed at an English audience, and this is hardly advertising. It may even have a reverse effect, as it frustrates the hell out of people.
Your site looks good actually, and you've got a nice list of features there. Have you considered hiring trainees to translate your site and product? You target-audience could grow quite big
--edit--
Removed sig. Said "start learning English", but it translated back to "parasitic". That didn't make it sound like good advice anymore.
My apologies.
|
|
|
|
|
hi, MyFrinds.
Please Help me!
Read my Source Code :
{
...
System.Threading.Thread lengthyprocessthreadanbar =
new System.Threading.Thread(new
System.Threading.ThreadStart(RunLengthyProcessanbar));
lengthyprocessthreadanbar.IsBackground = true;
lengthyprocessthreadanbar.Start();
_pleasewaitdlg = new Anbar_PleaseWait();
_pleasewaitdlg.ShowDialog();
...
}
void RunLengthyProcessanbar()
{
SetupForm();
_pleasewaitdlg.shouldclosenow = true;
}
private void SetupForm()
{
SqlConnection cnA = new SqlConnection("ConnectionString...");
SqlCommand cmA=new SqlCommand ();
cmA.Connection = cnA;
cmA.CommandText = "Command Text ...";
int RowActive = 0;
if (cnA.State != ConnectionState.Open) cnA.Open();
SqlDataReader readA = cmA.ExecuteReader();
while (readA.Read())
{
dgvAnbar.Rows.Add(1);
dgvAnbar.Rows[RowActive].Cells[0].Value =
readA[0].ToString();
}
cnA.Close();
}
www.ggsoft.ir
mohsen5459@gmail.com
Thanks.
Welcome Mohsen Sabzaliyan
|
|
|
|
|
I read it!
I hope you feel better now!
Just as a comment I will use 'using' at the top of the file, so as to avoid long.class.name, will use shorter variable name with upper case at the top of each word.
That will increase readability which, in turn, will make the code easier to: understand / debug / maintain!
also I will use the other using to dispose of disposable resouce as is:
using(SqlConnection cnA = new SqlConnection("ConnectionString..."))
{
......
}
this is a lighter syntax than try {} finally {} which makes sure that disposable resource are disposed even in case of exception or misplaced return statement!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
|
|
hi
add this line to main function to disable CrossThread checks:
Control.CheckForIllegalCrossThreadCalls = false;
like this:
static class Program
{
[STAThread]
static void Main()
{
Control.CheckForIllegalCrossThreadCalls = false;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
|
|
|
|
|
And wait for the app to die at some point? These are 'illegal' cross thread calls and the warning is thown for a reason!
Removing the check just stops that, but doesn't solve the underlying problem. It's easy to fix so that the control is invoked when necessary.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Check out Luc's article here[^]
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
http://javaflowswithin.blogspot.com/2010/03/c-threadsafecontrol.html
|
|
|
|
|
How can I create a named range in a C# excel report for cells that aren't lined up next to eachother?
I've seen examples on how to create a named range for consecutive cells (i.e. A1:M1), however the cells I need to name are scattered throughout the report (i.e. A1, H3, J9, S17, etc).
In excel, I could just do this by holding CTRL + click, but how can I do this in c#?
Thanks.
|
|
|
|
|
You can Create list of Range insted
List<Range> myrng = new List<Range>(20);
myrng.Add(excelWorksheet.get_Range("A1", "B3"));
and for one cell use Range like this:
Range rng1 = excelWorksheet.get_Range("A1", "A1");
then set property of each in loop
|
|
|
|
|
hi
sorry this is a reposting , but im in need od solution ASAp.
i need to find a way to know which application/process is using my com1 port.
|
|
|
|
|
I think you're being quite rude - so why should you get help ? If people dont answer your question, its generally becuase
a) the way you asked it - using 'asap' for example was incorrect
b) they dont know the answer
c) they are too busy to respond right now (there are very few full time staff on CP, mainly editorial, not content) - the rest of us inmates are volunteers who have jobs elsewhere !
So in future, watch how you ask the question and try to be a little self sufficient. fwiw, You can use the process explorer tool from SysInternals (now owned by Microsoft) to search for open handles. In this case you would want to search for 'Serial' since it uses device names that may not map to com port numbers. (e.g. COM1 is \Device\Serial0 on my system).
Sysinternals also have a tool called 'portmon', but I think that has to be running before anything (else) access the com port.
http://technet.microsoft.com/en-us/sysinternals/bb795533.aspx[^]
That information comes to you via Google - so if you had done a little work on your own you'd probably have had the answer by now ....
'g'
|
|
|
|
|
Im soo sorry about that, i was a bit stressed out about my work....thanks garth for your answer.
but i cannot download any of these softwares...ive got to write a program to find it
thanks so much
ani
|
|
|
|
|
cant download from MS Technet ? I'd tell someone at your work to pull their head out of their butt and allow the access so you can get the tools you need to do the job
aniarun wrote: ive got to write a program to find it
yeah, its called a browser, and MS have done it already ! you shouldnt have to write a downloader ... gawd, I often think I have a tough life !
'g'
|
|
|
|
|
thanx garth
ya, i meant that i have to write a program to find the praocess which is using my port lol.
man makes hisife hard :P
good luck
|
|
|
|
|
Why can't you download the software you need to do your job? That's ridiculous!
If you'd like to have portmon, click the 'email' link and let me know. If I can download it I'll be happy to email it to you. That should get past any work-imposed download blocks, assuming they're not monitoring your emails, too. Of course, if your boss demands that you write it, this won't do you much good... But we can try.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Hi thanks for that but im in need of writing one
what is \\Device\\serial0 is it the device name?? how do i know the name of it on a unknown machine(that is if i duno the available ports. my laptop gave me \\Device\\winachsf0)
thank you soo much
|
|
|
|
|
I'm not sure what that means, other than it is most likely the Windows internal name for the first serial port on the machine. You might find it beneficial to spend some time researching device driver development on MSDN. I don't know how much information is available there, but MSDN often contains a lot of clues about internal workings of the Windows system. If you can find them, of course. Try Google first.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|