|
i have comboBox filled from data source,
then i should select an item from it to insert into another table on the same datasource through input parameter
i have tried :
AnaName.Value = comboAnaName.SelectedIndex.ToString();
AnaName.Value = comboAnaName.SelectedText;
AnaName.Value = comboAnaName.SelectedItem.ToString();
but all failed
please help
regards
|
|
|
|
|
Mr.Kode,
Why did it fail?, what error did you get?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
I've got a TextBlock wich varies in With and FontSize. I want to fill it completely with spaces. How can I calculate how much spaces I need to fill the entire TextBlock?
gr.
Kevin
|
|
|
|
|
Do you want to replace all text with spaces?
Just get the text length and insert as many spaces.
|
|
|
|
|
"Do you want to replace all text with spaces?"
No.
The situation is a bit more complex.
But lets say the TextBlock is empty and I would want to fill it with spaces. The only data I have is the Width of the TextBlock and the FontSize.
If I would know the "width" of a space in the same FontSize I could calculate how many I would need.
But how do I calculate the width of a space?
|
|
|
|
|
Graphics.MeasureString can give you size of string in mentioned font. Will that help?
|
|
|
|
|
I sounds like it could work. But how do I use it?
I can't make a new instance of it, like Graphics g = new Graphics();, And when I just use Graphics. I don't get MeasureString.
Can you help me with this.
|
|
|
|
|
Graphics oGx = this.CreateGraphics();
I still dont understand the requirement to insert spaces.
|
|
|
|
|
Maybe I should have mentioned that I'm creating WPF application and not a WindowsForms application.
I have a TextBlock in a ScrollViewer. The ScrollViewer moves it position so you will see another part of the TextBlock.
This creates somekind of Marque. At the start I want the text to start off the screen therefor I need the spaces.
|
|
|
|
|
You should have:
a) Posted this on the WPF forum
and
b) looked into the FormattedText class to see what methods are available there (hint - take a look at the GetMaxWidths method).
|
|
|
|
|
Thanks.
I'll post these thing in the WPF forum the next time.
For the Info: I've used the formattedText.WidthIncludingTrailingWhitespace Methode to calculate the width of 1 space.
|
|
|
|
|
You need to use the Graphics context that you're currently rendering with (e.g. the one that's passed in to the OnPaint method)
|
|
|
|
|
Hi everyone,
I have this little problem: for my program I have to place some labels over an image. The user can drag and drop the labels and move them around and the location is saved to db. The problem is that when I resize the form (and the image itself) the labels' location is lost, in the sense that they moved from the original position set by the user. I can understand that that is due to the fact that the location of the label is set to the parent container, but how can I reset the location on every resize? this also happens for instance if I start the form in full screen mode. Thanks.
|
|
|
|
|
Just attach to the Resize event of the ImageBox or Form or whereever you have the image.
|
|
|
|
|
I did try that: got the width and height before resizing, width and heith after resizing and calculate the new point in comparison to the old one. It almost worked: almost because even if the label do not move as much as before, they still move a bit instead of being in the exact same position over the image. Maybe my equation was wrong?
newX = (new_width * oldX) / oldWidth;
|
|
|
|
|
NETtune wrote: Maybe my equation was wrong?
I normally get those wrong too, best is the try some combination's and see what works.
PointToScreen and PointToClient may be helpful.
|
|
|
|
|
Hi!
in .net,how to get the pagenums of pdf file?
|
|
|
|
|
5
(hint: you need to specify a bit more information, like your environment, the tools you are using, etc)
|
|
|
|
|
OS:WindowsXP, visita
C#.net, .Net Framework2.0
How to get the pages of pdf file to coding(C#)?
|
|
|
|
|
42
|
|
|
|
|
Hi
I have a datatable having 10 records. I want to insert the 10 records to a table in a database using stroed procedure from my front end C#. How to do? can any one help me please?
Thanks in advance
kesavan
|
|
|
|
|
I am creating one windows application using Asp.Net 2005 with C#. I have one Label control and one button control on the Form. I am having one Class in my solution too.
I am creating the object of my class in the button_click event and calling the function ChangeLabel() as shown below.
private void button1_Click(object sender, EventArgs e)
{
Class2 c2 = new Class2();
c2.ChangeLabel();
}
Now in that ChangeLabel() function I am changing the text of the Label control but it is not reflecting on the form.
PLease help me.((
Akash Agarwal
|
|
|
|
|
Akash Agarwal wrote: Class2 c2 = new Class2();
c2.ChangeLabel();
So where is the Label's instance you are referencing?
|
|
|
|
|
Actualy I do not want to send the label reference like c2.ChangeLabel(ref label1). instead of this I want to find that label control in the ChangeLabel() method itself, may be by extracting that label control from control collection of FORM or something like this.
Akash from India
Akash Agarwal
|
|
|
|
|
Well you are going to need a reference to the Label's form or itself, else it wont be possible.
|
|
|
|