|
Hi,
I want Rotate My Image One after another in adrotator control without refreshing the page.
send me code if there is any possibility by using of HTML or JavaScript
I must to set that Image not on the entire page. Just in One location
Balu
|
|
|
|
|
I don't think that that is possible on the client side.
Use AJAX.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
How do i get a count of the number of forms in a project (.sln) file. I need to create an application in C# that can read a '.sln' file and and give me a count of the total number of forms in it. Any suggestions guys
|
|
|
|
|
The form files are listed in the project file, not the solution file. However, the solution file does list out the project files under it so you'll still need to read it. The solution file's format looks proprietary, so it looks like you have to parse it out yourself.
The project files are in XML. So, you can use .NET XML classes to easily read this. You'll want to count the File elements where SubType="Form".
|
|
|
|
|
Hi!!
I am a beginer in .net technology. Now i have to make a real time application - database program and i decided to use C# & the ado.net technology. I read some articles about this and now i have questions:
Is there a posibility to use the datagrid, and other controls in a connected mode?
This must be a real time system and i think the disconnected mode is a bad idea.
Or maiby the ado.net technology is not a good choise for this kind of applications, and i should use other technology
|
|
|
|
|
Hi all,
i have used the colorDialog from which the user can select a color for the text,
I have to display the color in a textBox but when i set the text of the textbox with the colordialog's color property it displays name for only limited colors and displays the RGB value for many of them.
How do i convert them to color names?
Any help in this regards will be appreciated.
Thanks & Regards,
Pramod
|
|
|
|
|
Not all colors have names. Period.
Why? Because there are too many color combinations.
2^24 colors to be exact, excluding alpha.
So... I recommend that you display the selected color in a PictureBox control.
|
|
|
|
|
Thanks, but i have to pick the name of the color and then
insert this name in a PHP file, this color will be set as
the font color in the PHP file.
Is there any other way to achieve this?
Waiting for ur reply.
Thanks,
Pramod
|
|
|
|
|
Hmmm... I'm no expert on PHP, but don't you have to pass into it the color's hex code?
Something like this: #00FF00
|
|
|
|
|
ok
can u tell me a way to get the hex value of
those colors
Thanks,
Pramod
|
|
|
|
|
Not all colors have names. Exclamation mark.
There are about 140 colors that have names and over 16 million colors that doesn't have a name.
But if you like, you can sit down and name them all. I'll help you with the first:
#000000 Black
#000001 BlackWithAnInvisibleHintOfBlue
#000100 BlackWithAnInvisibleHintOfGreen
#010000 BlackWithAnInvisibleHintOfRed
#000101 BlackWithAnInvisibleHintOfCyan
#010001 BlackWithAnInvisibleHintOfMagenta
#010100 BlackWithAnInvisibleHintOfBrown
#010101 BlackWithAnInvisibleHintOfGray
#000002 BlackWithASlightlyLessInvisibleHintOfBlue
#000200 BlackWithASlightlyLessInvisibleHintOfGreen
#020000 BlackWithASlightlyLessInvisibleHintOfRed
Now it's only 16777205 more to go. Good luck and have a happy life time inventing color names...
---
b { font-weight: normal; }
|
|
|
|
|
))
thanks for the advice !!!!!!!!!!!
well jokes apart,
i have to finish that work within today
if u got any good solution post it
Thanks,
Pramod
|
|
|
|
|
Colours are made up of 3 components (R,G,B) which can range in value from 0 to 255
255,0,0 Is called Red
254,0,0 has no name
etc
0,255,0 is called green
etc
etc
In html a colour can be represented as Hexadecimal, which is just the r,g & b numbers converted to hexadecimal. Search for how to convert decimal to hexadecimal - it is very easy.
|
|
|
|
|
Thanks all,
i got the code to get the Hex value of the color.
Pramod
|
|
|
|
|
Guffa wrote: Now it's only 16777205 more to go. Good luck and have a happy life time inventing color names...
Hah! Well put Guffa!
|
|
|
|
|
hi guys,
im using c#.. how can i get the hostname of a client pc from the server appliction in my network? i have no problem getting the IP address but i can't get the hostname... tnx in advance..
|
|
|
|
|
I think the GetHostbyAddress() method can help you.
the followed code is copyed from msdn:
try
{
IPAddress hostIPAddress = IPAddress.Parse(IpAddressString);
IPHostEntry hostInfo = Dns.GetHostByAddress(hostIPAddress);
// Get the IP address list that resolves to the host names contained in
// the Alias property.
IPAddress[] address = hostInfo.AddressList;
// Get the alias names of the addresses in the IP address list.
String[] alias = hostInfo.Aliases;
Console.WriteLine("Host name : " + hostInfo.HostName);
Console.WriteLine("\nAliases :");
for(int index=0; index < alias.Length; index++) {
Console.WriteLine(alias[index]);
}
Console.WriteLine("\nIP address list : ");
for(int index=0; index < address.Length; index++) {
Console.WriteLine(address[index]);
}
}
catch(SocketException e)
{
Console.WriteLine("SocketException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
catch(FormatException e)
{
Console.WriteLine("FormatException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
catch(ArgumentNullException e)
{
Console.WriteLine("ArgumentNullException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
catch(Exception e)
{
Console.WriteLine("Exception caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
Just do it!
|
|
|
|
|
Hi
I am using window form with C# as code behind I have created a user control and trying to call in the window application .I am able to load the dll in the reference but in the "my user control" of the toolbox it doesn't gets loaded the page is blank.If I hardcode in code behined too it doesnt get loaded in the form(GUI).
I dont know what causing the problem .Have any idea what I am suppose to do.
sasi
|
|
|
|
|
use this link to get the solution.
this link specifies how to create a usercontrol.
I tried and it worked fine.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
vbwlkwalkthroughcreatinginheritedcontrolwithvisualc.asp
those who win are those who believe they can
|
|
|
|
|
Hi All.
I want to write some code that have some method that in create bitmap of the current screen.
What i mean is when this method is call - there will be create file in name X.bmp that contain the info of the screen ( line pressing on PrtScn button ).
How can i catch the picture ? what windows method (maybe API function) i need to use ?
|
|
|
|
|
Hello there!
I am trying to write a simple app that will monitor and save any changes in clipboard into some kind of an array.
I found some clipboard monitor examples online and they work great monitoring clipboard; however, when i try to save a string each time it is changed the program freaks out.
<br />
using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Data;<br />
using System.Runtime.InteropServices;<br />
<br />
namespace ClipboardMonitor<br />
{<br />
public class Form1 : System.Windows.Forms.Form<br />
{<br />
[DllImport("User32.dll")]<br />
protected static extern int SetClipboardViewer(int hWndNewViewer);<br />
<br />
[DllImport("User32.dll", CharSet=CharSet.Auto)]<br />
public static extern bool ChangeClipboardChain(IntPtr hWndRemove, IntPtr hWndNewNext);<br />
<br />
[DllImport("user32.dll", CharSet=CharSet.Auto)]<br />
public static extern int SendMessage(IntPtr hwnd, int wMsg, IntPtr wParam, IntPtr lParam);<br />
<br />
private System.Windows.Forms.RichTextBox richTextBox1;<br />
<br />
IntPtr nextClipboardViewer;<br />
string dummy = "";<br />
int n = 0;<br />
string[] str_data = new string[50];<br />
private System.Windows.Forms.Button button1;<br />
private System.Windows.Forms.Button button2;<br />
<br />
private System.ComponentModel.Container components = null;<br />
<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
nextClipboardViewer = (IntPtr)SetClipboardViewer((int) this.Handle);<br />
<br />
}<br />
<br />
protected override void Dispose( bool disposing )<br />
{<br />
ChangeClipboardChain(this.Handle, nextClipboardViewer);<br />
if( disposing )<br />
{<br />
if (components != null) <br />
{<br />
components.Dispose();<br />
}<br />
}<br />
base.Dispose( disposing );<br />
}<br />
<br />
#region Windows Form Designer generated code<br />
private void InitializeComponent()<br />
{<br />
this.richTextBox1 = new System.Windows.Forms.RichTextBox();<br />
this.button1 = new System.Windows.Forms.Button();<br />
this.button2 = new System.Windows.Forms.Button();<br />
this.SuspendLayout();<br />
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;<br />
this.richTextBox1.Location = new System.Drawing.Point(16, 16);<br />
this.richTextBox1.Name = "richTextBox1";<br />
this.richTextBox1.ReadOnly = true;<br />
this.richTextBox1.Size = new System.Drawing.Size(544, 88);<br />
this.richTextBox1.TabIndex = 0;<br />
this.richTextBox1.Text = "richTextBox1";<br />
this.richTextBox1.WordWrap = false;<br />
this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged);<br />
this.button1.Location = new System.Drawing.Point(184, 176);<br />
this.button1.Name = "button1";<br />
this.button1.TabIndex = 1;<br />
this.button1.Text = "button1";<br />
this.button1.Click += new System.EventHandler(this.button1_Click);<br />
this.button2.Location = new System.Drawing.Point(360, 176);<br />
this.button2.Name = "button2";<br />
this.button2.TabIndex = 2;<br />
this.button2.Text = "button2";<br />
this.button2.Click += new System.EventHandler(this.button2_Click);<br />
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);<br />
this.ClientSize = new System.Drawing.Size(568, 273);<br />
this.Controls.Add(this.button2);<br />
this.Controls.Add(this.button1);<br />
this.Controls.Add(this.richTextBox1);<br />
this.Name = "Form1";<br />
this.Text = "Clipboard Monitor Example";<br />
this.ResumeLayout(false);<br />
<br />
}<br />
#endregion<br />
<br />
[STAThread]<br />
static void Main() <br />
{<br />
Application.Run(new Form1());<br />
}<br />
<br />
protected override void WndProc(ref System.Windows.Forms.Message m)<br />
{<br />
const int WM_DRAWCLIPBOARD = 0x308;<br />
const int WM_CHANGECBCHAIN = 0x030D;<br />
<br />
switch(m.Msg)<br />
{<br />
case WM_DRAWCLIPBOARD:<br />
DisplayClipboardData();<br />
store_data(n);<br />
n++;<br />
if(n == 50)<br />
{<br />
MessageBox.Show("STOP!");<br />
}<br />
SendMessage(nextClipboardViewer, m.Msg, m.WParam, m.LParam);<br />
break;<br />
<br />
case WM_CHANGECBCHAIN:<br />
if (m.WParam == nextClipboardViewer)<br />
nextClipboardViewer = m.LParam;<br />
else<br />
SendMessage(nextClipboardViewer, m.Msg, m.WParam, m.LParam);<br />
break;<br />
<br />
default:<br />
base.WndProc(ref m);<br />
break;<br />
} <br />
<br />
}<br />
<br />
void DisplayClipboardData() <br />
{<br />
try<br />
{<br />
IDataObject iData = new DataObject(); <br />
iData = Clipboard.GetDataObject();<br />
<br />
if (iData.GetDataPresent(DataFormats.Rtf)) <br />
richTextBox1.Rtf = (string)iData.GetData(DataFormats.Rtf);<br />
else if (iData.GetDataPresent(DataFormats.Text))<br />
richTextBox1.Text = (string)iData.GetData(DataFormats.Text);<br />
else<br />
richTextBox1.Text = "[Clipboard data is not RTF or ASCII Text]";<br />
}<br />
catch(Exception e)<br />
{<br />
MessageBox.Show(e.ToString());<br />
}<br />
}<br />
<br />
public void store_data(int n)<br />
{<br />
if(n!=0)<br />
{<br />
if(str_data[n - 1] == str_data[n])<br />
{<br />
n--;<br />
<br />
}<br />
else<br />
{<br />
str_data[n] = richTextBox1.Text;<br />
}<br />
}<br />
<br />
<br />
}<br />
<br />
private void richTextBox1_TextChanged(object sender, System.EventArgs e)<br />
{<br />
<br />
}<br />
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
MessageBox.Show(str_data[0] + "\n" +<br />
str_data[1] + "\n" +<br />
str_data[2] + "\n" +<br />
str_data[3] + "\n" +<br />
str_data[4] + "\n" +<br />
str_data[5] + "\n" +<br />
str_data[6] + "\n" +<br />
str_data[7] + "\n" +<br />
str_data[8] + "\n" +<br />
str_data[9] + "\n" +<br />
str_data[10] + "\n" +<br />
str_data[11] + "\n" +<br />
str_data[12] + "\n" +<br />
str_data[13] + "\n" +<br />
str_data[14]+ "\n" +<br />
str_data[15] + "\n" +<br />
str_data[16] + "\n" +<br />
str_data[17] + "\n" +<br />
str_data[18] + "\n" +<br />
str_data[19] + "\n" +<br />
str_data[20] + "\n" +<br />
str_data[21] + "\n" +<br />
str_data[22] + "\n" +<br />
str_data[23] + "\n" +<br />
str_data[24] + "\n" +<br />
str_data[25] + "\n" +<br />
str_data[26] + "\n" +<br />
str_data[27] + "\n" +<br />
str_data[28] + "\n" +<br />
str_data[29] + "\n");<br />
<br />
MessageBox.Show(str_data[30] + "\n" +<br />
str_data[31] + "\n" +<br />
str_data[32] + "\n" +<br />
str_data[33] + "\n" +<br />
str_data[34] + "\n" +<br />
str_data[35] + "\n" +<br />
str_data[36] + "\n" +<br />
str_data[37] + "\n" +<br />
str_data[38] + "\n" +<br />
str_data[39] + "\n" +<br />
str_data[40] + "\n");<br />
<br />
}<br />
<br />
private void button2_Click(object sender, System.EventArgs e)<br />
{<br />
<br />
IDataObject d = Clipboard.GetDataObject();<br />
if(d.GetDataPresent(DataFormats.Bitmap)) <br />
<br />
{<br />
MessageBox.Show("Bitmap data is Contained in the clipboard.");<br />
} <br />
else if(d.GetDataPresent(DataFormats.Text)) <br />
{<br />
MessageBox.Show("Text data is Contained in the clipboard.");<br />
} <br />
else {<br />
MessageBox.Show("Some other format of data is Contained in the clipboard.");<br />
}<br />
}<br />
}<br />
}<br />
<br />
please help.
Also, you know how Excel has that clipboard where you can copy up to 12 items. How can i Access those items?
thanks
nnn
|
|
|
|
|
Hello everyone,
I have a DataGridView in a windows form with three columns:
Column1 is TipoComboBoxColumn
Column2 is QuantidadeColumn
Column3 is SementeComboBoxColumn
I need the SementeComboBoxColumn to display values according to the value I select in the TipoComboBoxColumn.
How do I go about accomplishing that? The code below works in part, BUT when I'm editing the value of SementeComboBoxColumn, the other values for the other rows in this column disappear. This is driving nuts!
private void tabBAdetDataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (tabBAdetDataGridView.Columns[e.ColumnIndex].Name == "EspecieComboBoxColumn")
{
this.tabSementesTableAdapter.FillByTipo(this.sascrDataSet.tabSementes, tabBAdetDataGridView.Rows[e.RowIndex].Cells["TipoComboBoxColumn"].Value.ToString());
this.EspecieComboBoxColumn.DataSource = this.tabSementesBindingSource;
this.EspecieComboBoxColumn.DisplayMember = "Semente";
}
else
{
this.tabSementesTableAdapter.Fill(this.sascrDataSet.tabSementes);
this.EspecieComboBoxColumn.DataSource = this.tabSementesBindingSource;
this.EspecieComboBoxColumn.DisplayMember = "Semente";
}
}
Thanks in advance,
JC Carmo
|
|
|
|
|
Hello everyone,
Here's the scenario: I have three windows forms (frmMain, frmClients, frmOrders).
There's a button on frmClients that opens frmOrders.
Now, the question is: What's the code on frmClients to define that the frmOrders' MDIParent is frmMain?
Thank you very much for your time and help,
JC Carmo.
|
|
|
|
|
hi,if you declare frmOrder's MDiparent as frmmain,
then you cannot show frmOrder just like that.
you have to show the mdiparent of the formorder and then show formorder.
the code inside the button will be like
Order frm = new Order ();
FrmMain frmMain = new FrmMain();
frmMain.Show();
frm.MdiParent = frmMain;
frm.Show();
but infrmmain, the IsMDIContainer property should be set to true.
try this.
all the best.
those who win are those who believe they can
|
|
|
|
|
Hi,
u can simply write
frmOrders.MDIParent = this.MDIParent;
Hope that works for u
Regards,
Pramod
|
|
|
|