|
I need to draw the sun path with respect to the given input(Latitude,Longitude,Altitude and Azimuth).Am using Directx 9 in my WinForms.How should i draw the sun path??Any help is appreciated..
Regards,
Priya
|
|
|
|
|
Why do you need DX ? That means you want it in 3D ?
Do you not know how to calculate the position, or not know how to draw it ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I donno how to draw the sun path with the given input.Do i need to use any Directx tools or properties in .NET is enough?I dont have any idea of how to draw it.
|
|
|
|
|
Here's what I think you said.
I want to draw the path of the sun in a program. I have no idea about graphics programming, but I've heard of DirectX, so I figured if I posted here, someone would magically cause it all to make sense for me.
1 - DirectX is for drawing in 3D
2 - if you want to draw a static path, DirectX is overkill
3 - what do you mean ' the given input ' ?
You need to read up on the Graphics and Bitmap objects, then you need to get a handle on the maths you use to plot the path you want to draw.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have a Winforms application where I have to Textboxes.
I only want one of them to have text at any given time. So, I added
a TextedChange event to each of these TextBoxes that empties the text
of TextBox that is not receiving text.
The problem is this. If TextBox1 has the text "UT" and I then enter text
into TextBox2. The text is correctly removed but the first press in TextBox2
is ignored so the user has to enter it in twice. Once to empty the text of the
other TextBox and then again to actually have it show up in the TextBox being
typed to.
private void VIN_CHANGED(object sender, EventArgs e)
{
tbPlate.Text = string.Empty;
}
private void PLATE_CHANGED(object sender, EventArgs e)
{
tbVin.Text = string.Empty;
}
Anyone know how to get around the first stroke getting ignored?
modified on Thursday, May 1, 2008 3:41 PM
|
|
|
|
|
They both go away, becaues when you empty the other textbox it fires that box's textChanged event thus clearing the second box...it works the second time because the box is already clear. You'll probably have to use a flag to show if you should change it..or put some logic in the event to check if that box has focus i.e.
<br />
private void textBox1_TextChanged (object sender, EventArgs e)<br />
{<br />
if (textBox1.Focused)<br />
{<br />
textBox2.Text = "";<br />
}<br />
}<br />
<br />
private void textBox2_TextChanged (object sender, EventArgs e)<br />
{<br />
if (textBox2.Focused)<br />
{<br />
textBox1.Text = "";<br />
}<br />
}<br />
this prevents the event from doing anything if its control isnt the one bieng typed in..oh i'm using .NET 3.5 i dont know when the Focused property was added...i've never had to use it before, but there should be something similar in each version.
Hope this helps..if you have any more questions feel free to ask.
|
|
|
|
|
Thanks, you hit the nail on the head. I didn't realize that there was a domino effect going on.
|
|
|
|
|
How can I call one event from within another? For example, say I have the two events, one for a button and one for a textbox.
private: System::Void Button_Click(System::Object^ sender, System::EventArgs^ e)
private: System::Void TextBox_KeyPress(System::Object^ sender, System::Windows::Forms::KeyPressEventArgs^ e)
In the button’s click event after processing something I wish to focus on text box and validate user input in textbox. I have tried the following:
private: System::Void Button_Click(System::Object^ sender, System::EventArgs^ e)
{ // Do something
if(TextBox->CanFocus == true)
{ TextBox->Focus();
}
TextBox_KeyPress();
}
It doesn’t work because I do not know what arguments to pass. Also after validating user input in KeyPress event I wish to return to Button_Click event. Can I do that by simply saying ‘return’ in KeyPress event? Thank you for all help.
|
|
|
|
|
Hi,
I don't have the complete answer, and my examples will be C#, but here it goes:
1.
you can call your own event handlers from anywhere you like, and provide real or dummy
arguments (if the handler does not use them, dummies would be sufficient), just look at
the handler's prototype and pass either null (=dummy), new MyEventArgs(...), or a real EventArg.
2.
However you are not really supposed to call event handlers directly; instead you should
cause events to happen. Some Controls have methods for this purpose, e.g.
Button.PerformClick().
3.
When the required method does not exist (e.g. typing to textbox) you could extract the core
of the KeyPress or KeyDown handler, put it in a new method, and call that at will, without
it requiring the object sender and the specialized EventArgs argument, using simple data
arguments instead (such as char theNewKeyChar).
|
|
|
|
|
ok i have a big problem here,,,,i iam complete new to vb and programing... and i have my first proyect to do on a windows Form...i am trying to learn by reading and testin ideas,,,,
well here we go!!
i gave this code i will like to make simple as posible...
i will like to have 2 textbox 1 for imput and the other for the anwser...
i have to imput some how 0 true 9 and A to Z (all Caps)with some characters allready asing to them...
i think the idea is keypress but then again i have no idea how to start on this one.....
Exp:
when i type on textbox 1
0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
it will show on txtbox2
Ï Î Í Ì Ë Ê É È Ç Æ ¾ ½ ¼ » º ¹ ¸ · ¶ µ ´ ³ ² ± ° ¯ ® - ¬ « ª © ¨ § ¦ ¥
it has to be exact the same sysmbols for letter and numbers like this....
Ï Î Í Ì Ë Ê É È Ç Æ
0 1 2 3 4 5 6 7 8 9
¾ ½ ¼ » º ¹ ¸ · ¶ µ ´ ³ ² ± ° ¯ ® - ¬ « ª © ¨ § ¦ ¥
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Please i will thank you guys for ever on this one...
its urgent...for me...please!!!
|
|
|
|
|
What are you having trouble with? If you are just looking for how to get a symbol into a text box, I would use the Chr() method. Start a new project, but textbox on the form, and then use this code and run the project...it will display a list of which integer values will be converted into which characters.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Dim sb As New System.Text.StringBuilder<br />
For intI As Integer = 1 To 255<br />
sb.Append(intI & vbTab & Chr(intI) & vbCrLf)<br />
Next<br />
TextBox1.Text = sb.ToString<br />
End Sub
Hope this helps.
|
|
|
|
|
|
You can access what was typed in txtbox1 by simply referencing the Text of it...like this: txtbox1.Text
So what you need to do is walk through each character in the string...which you can do with a For Each statement[^]. You will want to reference txtbox1.Text.ToCharArray as the In portion of the For Each statement. Then write the corresponding character to textbox2.
Hope this helps.
|
|
|
|
|
thankx bud ....but to be honest since i have no clue on how to start this proyect i think i will need a head start...no clue on how to do this...if is not to mutch to ask can o get a litle code to base my self on even if is
txtbox1
1 2 3 A B C
to
txtbox2
Ï Î Í ¾ ½ ¼
if is not posible...thanks anyway...sorry bud but i iam a complete noob on this one...
|
|
|
|
|
I use EnumChildWindows function to get child windows of my main dialog.If there is a child dialog in my main dialog, can i get child windows of this child dialog by using this function?(grandchild windows) Thanks
|
|
|
|
|
You're using WinForms, right, not MFC or vanilla C++ ? Why not iterate over the collection of open forms, or the child forms of the main form ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Do you know if it is possible to display a Windows Form as a rounded rectangle like this - http://tinyurl.com/6j2abw[^]?
If so then how would I do this?
|
|
|
|
|
|
"Monitors set to a color depth of greater than 24-bit can have display problems with certain parts of the form not being transparent, despite setting of the TransparencyKey property. To avoid this problem, ensure that the monitor's color depth is set to less than 24-bit in the Display control panel. When developing applications that feature this transparency, keep in mind that you will have to make your users aware of this issue."
It appears that nonrectangular winforms have a few quirks and may have some issues on different users computers based on the configuration of their computers (which is not an issue with rectangular Winforms).
Also, it appears that it may take a bit of time to develop a fully functional rounded rectangle Winform to create the design and to implement the behavior that is already built into the standard rectangular Winforms.
I want to implement a modern looking UI but I don't want to spend 100+ hours of work revising and testing with the possibility that the Winform may not display correctly in some user configurations.
|
|
|
|
|
Hello
I have a little problem(quite anoying actually) with databound datagridview.
I have continued working on somebody else’s project and it is quite hard.
The grid has 5 columns, and all of them are DataGridViewTextBoxColumns(all are databound), and
everything works fine. The grid loads entries from the database and so on.
I have to change somethings now to satisfy my boss.
I sholud add some empty rows(I can do that) and in the added rows the first cell sholud be a
DataGridViewComboBoxCell instead of DataGridViewTextBoxCell.
Is this possible with databound gridview?
I have tried but cannot get it to work right. can you help me please, I’m quite desperate now. Is
it possible to exchange private messages with you. I’m grateful in advance for any help you can
offer. Best regards, Linn
|
|
|
|
|
i have some experience..not necessarily good.. with the winforms datagrid in .NET 1.1, and as far as i could tell you couldnt change the type of column on a per row basis...i.e. if col1 is a textbox in row 1 it will be a textbox in any other row...same for the other controls...to change what a column is you have to define the template here's an example from .net 1.1 and c#
bool columns are checkboxes if you were wondering..i assume there's a control for a combobox or ddl, but i didnt use it. sorry about the formatting..
private void AddCustomDataTableStyle()<br />
{<br />
DataGridTableStyle ts1 = null;<br />
DataGridBoolColumn boolCol = null;<br />
DataGridTextBoxColumn textCol = null;<br />
<br />
ts1 = new DataGridTableStyle();<br />
ts1.MappingName = "name";<br />
<br />
ts1.AlternatingBackColor = Color.LightGray;<br />
ts1.GridLineColor = Color.Black;<br />
<br />
ts1.SelectionBackColor = Color.Blue;<br />
ts1.SelectionForeColor = Color.White;<br />
<br />
ts1.RowHeaderWidth=15;<br />
this.dgSettings.RowHeaderWidth=15;<br />
<br />
boolCol = new DataGridBoolColumn();<br />
boolCol.MappingName = "Auto";<br />
boolCol.HeaderText = "Auto";<br />
boolCol.Width = 50;<br />
boolCol.AllowNull = false;<br />
boolCol.TrueValue = true;<br />
boolCol.FalseValue = false;<br />
<br />
ts1.GridColumnStyles.Add(boolCol);<br />
<br />
textCol = new DataGridTextBoxColumn();<br />
textCol.MappingName = "lastModified";<br />
textCol.HeaderText = "Modified";<br />
textCol.Width = 110;<br />
textCol.ReadOnly=true;<br />
ts1.GridColumnStyles.Add(textCol);<br />
<br />
dgSettings.TableStyles.Add(ts1);<br />
<br />
TablesAlreadyAdded = true;<br />
}
hope this helps some
|
|
|
|
|
Hi all ,
is there any way to increase the message box size ,like 1/4 of the desktop .
thanks ,
CSN
|
|
|
|
|
Changing the default message box is not possible. You can write your own message box.
|
|
|
|
|
|
is it possible to program windows using C# , and calling the winAPI functions or the msgina functions from the code ,
help is needed
thanks in advance
There is always something to learn
|
|
|
|