|
Ok, i figured out most of it...
What I am doing now is that I am parsing out all the input tags with type=file... these are the file upload input tags using HtmlElement and setting their mouseup and keypress event handlers to my custom handler.
Now that i am done with this I am trying to do this:
HtmlElement elm = .....;
if (elm.GetAttribute("type") == "file")
{
elm.SetAttribute("value", myString);
}
this is not working! is there any way set the value attribute on the input tag?
|
|
|
|
|
Hi to all,
I'm having a problem... i have to get child rows from a Datagrid control on another application, i'm using IAccessible interface to get Datagrid control (it works ), but i'm don't have any idea about get child rows . In another words, i have to get datagrid content and later use it for another operations.
There is the method used to get DataGrid IAccessible interface:
IAccessible FindAccObj(string controlName, out int childID);
Thanks in advance to any help. 
|
|
|
|
|
Hello there,
First of all I know this is a question asked many times etc. But still I'm quite stuck since I haven't found an answer that would work for my case.
So, my project is made in Borland (C# Builder) and consists of following:
- I have a panel where graphs are generated (note: 2+ graphs)
- I have sliders to change the values inside graph function (to make them longer, move them up or down, etc.)
The problem I'm having is that, when I move the window out of bounds, or place another window over my graphs, they just disappear.
I've read about the OnPaint, but I'm not sure how I'm suppose to add this to my code, since my graphs are updated every time trackBarNR_Scroll event occurs.
Oh and finally, of course it's suppose to be a Windows Application
Hopefully someone could guide me, how to make those graphs not disappear 
|
|
|
|
|
Where/how are you creating the graphs?
Are you not drawing using the Paint event of the Panel?
Calin
|
|
|
|
|
As a matter of fact, I'm not (and besides I'm not that familiar with C# yet )
One of the Graphics function is here (and that is called every time I have trackBarNR_Scroll):
private ArrayList GraphPointsList2 = new ArrayList();<br />
<br />
private void DrawGraphic2(int k3, int k4)<br />
{<br />
int i=1;<br />
int j=1;<br />
int x=0;<br />
int y=0;<br />
double value=0;<br />
double sin=0;<br />
<br />
Point GraphPoint2;<br />
<br />
System.Drawing.Graphics graph2;<br />
graph2 = GraphPanel.CreateGraphics();<br />
graph2.SmoothingMode = SmoothingMode.AntiAlias;<br />
Pen penCurrent2 = new Pen(System.Drawing.Color.Red, 2);<br />
<br />
for(x = 0; x<GraphPanel.Width; x++)<br />
{<br />
GraphPoint2 = new Point();<br />
<br />
GraphPoint2.X = x;<br />
<br />
sin = Math.Sin((0.01*k4)*x);<br />
value = 50*-sin+k3;<br />
y = GraphPanel.Height - (int)value;<br />
GraphPoint2.Y = y;<br />
GraphPointsList2.Add(GraphPoint2);<br />
i++;<br />
j++;<br />
}<br />
<br />
Point[] pointArray2 =<br />
( Point[] ) GraphPointsList2.ToArray( GraphPointsList[ 0 ].GetType() );<br />
<br />
graph2.DrawCurve(penCurrent2, pointArray2);<br />
}
|
|
|
|
|
Well, you may use this function in Paint event.
Add an handler for Paint event of GraphPanel and use e.Graphics (instead of GraphPanel.CreateGraphics() )
In this way, your graphs will be drawn every time when the Form is repainted. Now, call GraphPanel.Refresh() in trackBarNR_Scroll() in order to refresh the graph when scrolling.
Calin
|
|
|
|
|
Thanks, I'll try that out
|
|
|
|
|
Hi,
here are a few simple rules that should guide you:
there are several steps to draw something so it becomes visible on the screen:
1.
decide upon what object you want to draw; it normally is a Control (e.g. a Panel) or a
Form itself. I prefer to add a Panel to a Form, then draw on the Panel.
2.
create some variables (Rectangle, struct, class, whatever) that hold the parameters of
your drawing. For a rectangle that could be top and left coordinate, and width+height,
or just a Rectangle. etc.
3.
create a Paint handler (either add your own paint handler to the Paint event, or
override the OnPaint method) for that Panel, and do all your drawing in there,
using the Graphics class and your variables.
4.
when you want to change things, modify the variables and call Panel.Invalidate() or
one of its overloads (for selective invalidation).
5.
If you want to animate things, perform the move (step 4) inside the Tick handler
of a Windows.Forms.Timer
BTW: if you need to create some objects (Fonts, Pens, Brushes, ...) either keep them
alive in class members (hence create them only once); or create them inside the Paint
handler and don't forget to call Dispose() on them.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Those are some really useful steps, I'll try to keep them in mind
Thanks a bunch.
|
|
|
|
|
Did u solve your problem???
A S E L A
|
|
|
|
|
God took ages to find my post ..
Anyway I've made some progress and still stuck on other part.
I have 3 different functions, one for graphic, second for graphic and third for axis.
I solved the paint problem with Axis, since its static and never changes, so it was quite easy to convert to paint event. On the other hand, graphs have both 2 parameters that they receive and the graph changes after that according to the values given.
Example : public void JoonistaGraafik(int k1, int k2)
now when I want to make it to paint event "public void JoonistaGraafik(object sender,PaintEventArgs e, int k1, int k2)"
I have problem calling out in InitializeComponents();
this.GraphPanel.Paint += new System.Windows.Forms.PaintEventHandler(JoonistaGraafik(slider_a, slider_b));
the thing is that, my two values "slider_a" and "slider_b" are generated in the trackbar_scroll event and then JoonistaGraafik(slider_a, slider_b); was called out.
I'm pretty bad in explaining, but I hope that made a bit sence.
In conclusion, the question is, how can I call out
"this.GraphPanel.Paint += new System.Windows.Forms.PaintEventHandler(JoonistaGraafik(slider_a, slider_b));"
if the slider_a and slider_b values have to change when I move the trackbar.
Thanks, and sorry for not replying so fast.
|
|
|
|
|
Hi
I have enter event for textbox that change the background color
How can i activate this event from my button click ?
thank's
|
|
|
|
|
If the signatures are the same, then they can call the same event. If not, and I don't think so, factor your code out to a method and call it from both events.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
4 people answered this question few posts below. You should follow williamnw's advice and put your code in a separate method and call it from the button's click too.
Eslam Afifi
|
|
|
|
|
sometimes, I am out of my mind and can't even think about trivial things.
While it is ok, to ask questions, no matter how trivial they might be, but if the questioner does not understand the response, it shows lack of understanding of the basic idea they are asking.
At least if the OP would ask a fellow up question (of course on the same thread) or ask for clarification, it shows they are in the discussion. Just simply going and creating a new thread because s/he did not understand the response is sheer maddening.
Yusuf
|
|
|
|
|
Yusuf wrote: sometimes, I am out of my mind and can't even think about trivial things.
Yeah, it happens. Sometimes, I look at some code I wrote and I realize that it could have been done better. Sometimes, the simplest things don't cross the mind.
Eslam Afifi
|
|
|
|
|
I still dont understend, can i get sample code ?
|
|
|
|
|
E_Gold wrote: I still dont understend
How are you going to understand if you keep posting the same question, again and again. See what people are suggesting, understand the reply then if there are area not clear to you post follow up questions on the same thread. That way the discussion can continue until you understand it.
E_Gold wrote: can i get sample code ?
what good is it to get a sample code with out understanding the basic problem.
Way way back, I took a class with a very good professor. It was a programming class. Before we could submit our code, he would ask us to present a pseudo code. The pseudo code does not have to resemble real code. You could write him a paragraph of the problem and how you intent to solve it. then he will give us the go ahead to code it. I found that technique to be very helpful and still use it in my professional work everyday. In Fact I solve most of my problems away from the computer.
Step back write down what you are trying to do, then when evey thing is clear in your mind it is very easy to write the code. The code is nothing but syntex and symantec, still you will need to come up with the logic.
Yusuf
|
|
|
|
|
You can call the method that normally handles the event directly as has been suggested.
To actually raise the event you need to get access to the TextBox's OnEnter method. This isn't as easy as the question you posed earlier so I think the others are being a bit harsh flaming you.
There are two ways that I know of. The first involves reflection:
typeof(TextBox).GetMethod(
"OnEnter", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic
).Invoke(
textBox1, new object[] { EventArgs.Empty }
); The other is to subclass the TextBox and add a public PerformEnter method. From it call OnEnter(EventArgs.Empty) , and use your derived TextBox instead of the original.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
thank you very much!!!
this exactly what I need.
|
|
|
|
|
Doing what he suggested in your instance, makes you an idiot. If you couldn't understand my answer, then you're an idiot. You sure as hell should not be writing any code that anyone is paying for, or that will be used anywhere.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I was about to 1-vote you for demeaning this person - then I saw his user details, and he is a software developer! (I had sort of assumed he was a kid with little or no experience)
Have a 5 instead!
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
I agree totaly - I was working on the assumption that he *really* wanted to raise the event again (for reasons unknown) as he said in the question.
Of course, if all he wants to do is re-run the handling code for the Enter event, all he needs to do is call that method, or move the code out to a common method and call that from both handlers.
(Btw, TextBox.Enter and Button.Click do both have the same signature.)
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Hi
people, why you so angry ??
isn't this forum for asking question ?
English in not my mother tongue and maybe i don't explain my self well
if someone uninterested to help - don't help !!

|
|
|
|
|
I have a publish/subscribe application running on a single machine.
The system uses 2 ipc remoting channels, one set up on the installed service (which has no issue) and another set up on a client.
The client sends uri information to the service via the service's remoting channel so telemetry can be sent to the observing client. I can connect to the service and do everything I need to do with it's ipc channel, but when I try to connect to the client's channel I receive an Access Denied error.
The service is installed as "Local System" permission. I presume that this is a security issue but I can't seem to get it right... Any suggestions?
Thanks!
Scott P
"Simplicity carried to the extreme becomes elegance."
-Jon Franklin
|
|
|
|
|