|
Hi,
You can set the TabControls RightToLeft property to true.
Thanks
SGS
|
|
|
|
|
I tried that, but the tabControl stay left to right
Thankx
|
|
|
|
|
i've create a paintbrush program where i have a panel on the form and on it the user can draw circles, lines or rectangles. the problem is the when i drag the form down or minimize and maximize it again the drawing which the user has done is erased. how can i stop that from happening? should i use an arraylist?
Adi
|
|
|
|
|
|
Hi,
I built a structure via:
CreditCardStruct CCStruct = new CreditCardStruct( );
I then fill in the variables with code not shown & pass the structure as a reference to a .DLL written in C via:
[DllImport("mcpc.dll", EntryPoint="_ProcAuthorizationWeb@4", SetLastError=true)]<br />
public static extern bool _ProcAuthorizationWeb(ref CreditCardStruct CCStruct);<br />
...<br />
rc = _ProcAuthorizationWeb(ref CCStruct);<br />
_ProcAuthorizationWeb updates the variables in the CreditCardStruct but when I come back from ProcAuthorizationWeb, CCStruct is out of scope. How do I keep CCStruct in scope when I return from the call?
Glenn
|
|
|
|
|
|
hi,
Sometime last week I had posted a messsage regarding how to change the background color of a column in a listview that a user clicks upon. I did manage to get a partial solution after viewing some sample code online. Now at the moment my solution doesnot color the entire column that the user clicks upon. The color is rather limited to the number of subitems accumulated. I have included partial code below showing the ColumnClick event. The purpose of code is to mimick a windows folder.
Is there any this code can be extended to color the entire column ?? Any suggestions will be greatly appreciated.
thanks
ekynox.
code
private void listView1_ColumnClick(object sender,
System.Windows.Forms.ColumnClickEventArgs e)
{
TheColumnSorter.CurrentColumn = e.Column;
listView1.Sort();
/*clear current selected column*/
/*7 is the number of files in c:\temp*/
for (int index = 0; index < 7;index++)
{
ListViewItem theRow = listView1.Items[index];
theRow.UseItemStyleForSubItems = false;
ListViewItem.ListViewSubItem theCell = theRow.SubItems[column_clicked_history];
theCell.BackColor = Color.White;
}
for (int index = 0; index < 7;index++)
{
ListViewItem theRow = listView1.Items[index];
theRow.UseItemStyleForSubItems = false;
ListViewItem.ListViewSubItem theCell = theRow.SubItems[e.Column];
theCell.BackColor = Color.LightGray;
}
//column_clicked_history declared as a global variable
column_clicked_history = e.Column;
}
edit: removed a redundant variable and added couple of comments in code
|
|
|
|
|
The following is pseudocode that would solve a problem I have encountered with regard to process management. Could you kindly take a look at it and point me in the right direction regarding how to prevent lost processes from occurring in between application running attempts, if the user clicks the cancel button or abends the application?
If the user cancels the application module from running in the middle of processing, and that module spawns a series of processes, then some of those processes may still be running and will throw an error if the user tries to run the program again.
<br />
foreach (process in TaskManager.Processes)<br />
{<br />
if ((process.accesses(System.IO.File(fileName1))) ||<br />
(process.accesses(System.IO.File(fileName2))) ||<br />
(process.accesses(System.IO.File(fileName3))) ||<br />
(process.accesses(System.IO.File(fileName4))))<br />
{<br />
process.kill();
}<br />
}<br />
Would really appreciate some input to guide me in the right direction. I know that the code above probably does not exist, but is there some way of clearing all actively running processes that each access their own specific files so that the application can start fresh and clean. That way I would not get the following error message: "the file fileName2 cannot be accessed because it is being used by another process".
|
|
|
|
|
hi
i don't know of a way of doing directly what you want, especially in C#. Just two thoughts:
- You probably get the error message for files your program was using? check that each of your threads closes each file it uses when it's done with it.
- Closing all processes that accessed some file doesn't seem to be a healthy idea to me. Especially if u can insert any file name. If the problem is with specific files, maybe you should go the other way around, and inherit a "file" class to alert you (by an event) when it is accessed and by whom (which process)
hope this helps
there are no facts, only interpretations
|
|
|
|
|
Hello all
I am working on a project that is take an input file in c++ code ( simple code ) and prin out the symbol table .
can you help me please coding it by C#.NET?
my problem is how to take every token and number alone from the input file ?
Leedd
Thank you
|
|
|
|
|
Leedd wrote:
my problem is how to take every token and number alone from the input file
Have a look at this article for tokenizing your file.
|
|
|
|
|
|
Thank you guys Rohde and leppie
Thanks
|
|
|
|
|
I guess what I want is some kind of listener program that monitors what goes
out and comes in through the serial port (1016). So how do I do this? Please
mail me the code!
Thanks
Gustav Paul
PS. It's for a school Science Expo.
Gustav,
Soul
|
|
|
|
|
Gustav Paul wrote:
Please mail me the code!
PS. It's for a school Science Expo.
So you want us to just GIVE you part of your grade?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello ,
I am writing an application that gets a password and a user name from the user I need to send these information to a web site to check wheter these information is correct or not then the web site should respond to my application with the result.
How can I send these information to the web site and how can I get the result from it.
|
|
|
|
|
You should look into web services. Create a web service on the webserver that takes and username & password, and returns a bool.
If you didn't want to go that route, you could use a less sophisticated method, for instance, setup an html page and pass the user name & password data in the url, for example: http://mysite.com/q?userName=john;pass=doe
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Lies of Our Fathers: A Must-Know About Lent
Judah Himango
|
|
|
|
|
I want to try the second method(html page) but how can I get the result
|
|
|
|
|
Hmm, I'm not a web developer, so maybe someone with more experience can give you a better answer than me. If I were to guess, you could simply emit some html that contains the result. Use a WebRequest to navigate to your url, then have the page emit the return value, and you can read that value back on the client.
Again, there are better ways to do this. Web services seem like a good candidate.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Lies of Our Fathers: A Must-Know About Lent
Judah Himango
|
|
|
|
|
Hello Mohsen,
although this is going to be a crosspost , but thought you might not get the answer on the other forum. here is my answer there.
Hello Mohsen,
your question is way general. as we don't know are you using web services or simple aspx mechanism. or is your application a windows app that refrences a web service.
I suggest you try the TaskVision sample from the MSDN or download it from http://www.windowsforms.com/[^].
It should give you a great insight on how to use webservices to get what you want done.
if you simply want to get the answer is authenticated or not. use the ExecuteScalar sql function if it returned a record then save the success condition to a session variable and continue to the loged in area (response.redirect) other wise redirect him back to the old one.
cheers
It is Illogical to define an inventor by his invention
|
|
|
|
|
I developed a similar application ...Here is the my solution..
First , I created a web service which gets the input , then regarding to these inputs , returns the results...
In the web service
<code>
[WebMethod(Description="Login Operation")]
public string Login(string userName,string password)
{
HttpWebRequest req = (HttpWebRequest) HttpWebRequest.Create("http://[www.desiredsite.com/login.aspx?name="+userName+"&password="+passWord)
req.KeepAlive = false;
HttpWebResponse resp = (HttpWebResponse) req.GetResponse();
StreamReader sr = new StreamReader(resp.GetResponseStream(), System.Text.Encoding.UTF8);
string all = sr.ReadToEnd();
...
...
...
return resultString;
</code>
|
|
|
|
|
hay man what u need to do
ur question is not cleare
|
|
|
|
|
I got a frame with a progressbar. while a calculation is made the progressbar.value is added with 1.
the problem is that the frame seems to be inactive and only the progressbar is repainted everytime the value is increased.
How do you repaint a frame??
|
|
|
|
|
If the GUI thread is doing lots of work, your GUI might not get repainted, especially on slower machines.
To make sure your GUI gets updated, you can make a call to Application.DoEvents, or you could use a 2nd thread to do the heavy work, and use the GUI thread only to update the progress bar.
You can also force a control to repaint itself using control.Update().
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Lies of Our Fathers: A Must-Know About Lent
Judah Himango
|
|
|
|
|
Hello,
I have a problem!
I generate some html page and view it in WebBrowser control. I need to have fit to page option when i print the document.
I try varios methods but don't work.
Please help me!
simo
|
|
|
|