|
thanks about your answer,however my thought is not that;
I will give a Example
In windows Form if I put a Vunhat Named Created directory out directory debug and peer bin directory(or peer Debug directory)
I don't know how to find the files in VuNhat directory because
the default directory is actived is "......bin\\Debug\\"
help me
|
|
|
|
|
I ask permission to add ,If I use comannd File.Exist("Vunhat\\Hoang.txt"),the result is false
Hoang.txt is in the directory Vunhat and VuNhat peer Debug directory or peer bin directory
help me
|
|
|
|
|
use System.IO.Path.GetFullPath(file name);
|
|
|
|
|
[b]hey to all the forum
i create a tablelayoutpanel populated with label and pictureBox automaticlly loaded from a folder
and xml file
and i wanna know when the user select (click) on one of the picture or the label
and what's the coordinate of the selected cell
this is the code my tablelayoutpanel is named miniature[/b]
<code>imgSize = new Size(170, 170);
scanDirectory(folder, "*.jpg", System.IO.SearchOption.TopDirectoryOnly);
String selectedImage = selectedImg;
if (imgList == null)
return;
int a = 0;
miniature.ColumnCount = imgList.Length;
foreach (String img in imgList)
{
com_image.Text = com_image.Text + img + "\r\n";
l = new Label();
l.Text = img;
l.TextAlign = ContentAlignment.TopCenter;
miniature.Controls.Add(l, a, 2);
PictureBox pb = new PictureBox();
pb.Size = imgSize;
pb.SizeMode = PictureBoxSizeMode.Zoom;
pb.Image = Image.FromFile(img);
pb.BackColor = Color.White;
pb.Tag = img;
miniature.Controls.Add(pb, a, 0);
a++;
}
</code>
i tried miniature.GetCellPosition(); and miniature.PointToClient(new Point(e.X, e.Y));
but i don't know how to convert point to controls
thanks in advance
|
|
|
|
|
Off the top of my head, can you get the index of the selected cell's row? That might be better.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
i don't know but i dindn't find a fuction to give the selectedindex
but they must be function to give that
so if anyone can help
because i will give up
thanks
|
|
|
|
|
In minature is there anything such as Clicked or any event procedure that gets fired when you click on the controls? If so, you should be able to get info on the object that was clicked.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
there's a "private void miniature_MouseClick(object sender, MouseEventArgs e)"
but they treat all the tablelayout not cell by cell
you see?
|
|
|
|
|
dinosors wrote: because i will give up
Don't give up. I am not sure how much more I can be of assistance, but keep plugging along and I am sure you'll find some way to do what you need done
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
|
i think i 've found a solution to find the row and the cell
Point pointeur= miniature.PointToClient(new Point(e.X, e.Y));
for (int i = 0; i < imgList.Length; i = i + 170)
if (pointeur.X > i && pointeur.X < i)
{
//in the cell
if (pointeur.Y > 0 && pointeur.Y < 170)
{
//in the cell and the row
}
}
|
|
|
|
|
From what I see you are trying to do, and a quick glance, looks like you are on to something
Good luck and happy coding
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hello everyone,
I was wondering if there is anyway that I can change the colour of the Text displayed in a TextBox programmatically ?
Thank you very much and have a great weekend.
Khoramdin
|
|
|
|
|
Use the Foreground for changing the text color, Background for the background color.
|
|
|
|
|
hi
i want to print any control(such az richtextBox) in my app, but how to do ?
note : i don't want code, i want to know about stpes for done this operation
plz guide me, thanks
|
|
|
|
|
|
hi
how can i add the fade in /fade out effects
to a usercontrol i build
kobkob
|
|
|
|
|
Build a timer control,then change the form's transparence--Just change the form's Opacity Property.
|
|
|
|
|
|
hi, i like to know how to add
fade in/fade out effects to my usercontrol
Opacity works only with high level Objects (Form)
tnk' s
kobkob
|
|
|
|
|
I’m POSTING to an ashx file from my aplication.
What I want to do is just post information about some variables of my aplication, and never wait for an answer.
What I need is to avoid waiting for an answer, because I don’t need it.
I’m accesing the file this way.
-----------------------------
string queryString = "http://website/PrivateHandler.ashx";
System.Net.HttpWebRequest myHttpWebRequest = (System.Net.HttpWebRequest)WebRequest.Create(queryString);
myHttpWebRequest.Method = "POST";
myHttpWebRequest.ContentType = "application/x-www-form-urlencoded";
string strRequest = "mode=1&bID=1&gID=1";
UTF8Encoding objUTF8Encoding = new UTF8Encoding();
byte[] arrRequest = objUTF8Encoding.GetBytes(strRequest);
myHttpWebRequest.ContentLength = arrRequest.Length;
Stream strmRequest = myHttpWebRequest.GetRequestStream();
strmRequest.Write(arrRequest, 0, arrRequest.Length);
strmRequest.Close();
//Wait for an answer (I don’t need an answer).
System.Net.WebResponse resp = myHttpWebRequest.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());
sr.ReadToEnd();
---------------------------------
WebResponse and ReadToEnd are there because if I don’t read what return, I can only call the ashx file twice and then the system hangs.
What I need is to post multiple times and never wait for an answer and waste performance because of that.
Is there a way to achieve what I need?
Thank you very much.
Martín Suárez Viacava
|
|
|
|
|
It appears your are trying to use an HTTPHandler as a Web Service. Why not just create a Web Service?
only two letters away from being an asset
|
|
|
|
|
Thanks for your answer.
If I use a WebService, won´t I have a lot of extra overhead?
I´m trying to avoid overhead as much as possible.
Thanks again.
Martín Suárez Viacava
|
|
|
|
|
You will have a better performing solution. A HTTPHandler isn't meant to be used in the manner you are trying.
"All an HTTPHandler does really is take an HTTPContext object and work out what to do with it."
http://aspalliance.com/articleViewer.aspx?aId=441&pId=[^]
only two letters away from being an asset
|
|
|
|
|
What about use asynchronous delegate?
|
|
|
|