|
Hi, I am facing a problem in GDI+ drawing , I have drawn a rectangle on the panel and rotated to some angle. Anyone can guide me how can I apply mouse hittest on the rotated rectangle. I will be thankful to you. I am using following code to draw and rotate the rectangle.
<br />
Matrix mx = new Matrix();<br />
mx.RotateAt(30, new PointF(70, 70), MatrixOrder.Prepend);<br />
e.Graphics.Transform = mx;<br />
g = e.Graphics;<br />
Rectangle rect = new Rectangle (10,10,100,100);<br />
Regards,
|
|
|
|
|
abstract class is base class.why we declare in abs class.
and we implement in child class. directly we can implement in
child class.what reason?....
|
|
|
|
|
polymorphism
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
Because any class that derives from your abstract class is now forced to implement any abstract methods you may have there.
newman wrote: directly we can implement in
child class.what reason?....
You could extend that argument to all base classes - maybe you should buy a book on OOP?
|
|
|
|
|
Vikram A Punathambekar wrote: You could extend that argument to all base classes - maybe you should buy a book on OOP?
And get familiar with the concept called inheritance... pretty much powerfull... may save you a lot of work
|
|
|
|
|
Hi,
I am asked to do an user control which takes the input for the PageSize
and PageNumber.The User control also has a button on clicking which would set the PageSize and Page Number of a Grid.Grid is not part of a user control.
If a Page has a Grid control and my user control is registered in it.
How should I be doing this?I need an approach.Do I need to raise an event
from user control which will be captured by the page containg grid.
So that I can do databinding in that by assigning the values of pageSize and Page Index from User Control.
Any suggestions or links would be helpful.
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
I've been having some trouble with the webbrowser component.
I can only make it work with an combobox rather than an textbox.
When i input an address into the textbox it loads few seconds than crashes the programe.
With an combo box i need to pre-input webpages then it works,
i could use some help on how to replace the combobox with an textbox.
Thanks in advance
Ben
|
|
|
|
|
It would be impossible to judge the error without viewing ur code....
|
|
|
|
|
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
comboBox1.SelectedIndex = 0;<br />
webBrowser1.GoHome();<br />
}<br />
this would initialize the combobox way where i can input populate the combobox with serveral pages i like.
when i try with the textbox:
<br />
private void btnEnter_Click(object sender, EventArgs e)<br />
{<br />
wb1.Navigate(new Uri(txtbox1.TextChanged.ToString()));<br />
}<br />
'The solution is proply easy tough i'm just an beginner
|
|
|
|
|
i have used the Image Processing Lab tool which was created by Andrew Kirillov...
I have one doubt.. how can use colorfiltering.cs file as a main one(separate project's main file).
but i should watch the changes in image in preview window while clicking tha redslider or blue slider or green slider which is in
colorfiltering form design..
|
|
|
|
|
How do I wake a sleeping thread when Thread.Resume is obsolete?
Som
|
|
|
|
|
Make the thread call Monitor.Wait() on a lock variable, then have the waking logic call Monitor.Pulse() on the same lock variable.
MSDN documentation: http://msdn2.microsoft.com/en-us/library/system.threading.monitor.aspx[^]
Example:
<br />
class Threaded<br />
{<br />
private object myLock = new object();<br />
<br />
private void GoToSleep()<br />
{<br />
lock(myLock)<br />
{<br />
Monitor.Wait(myLock);<br />
}<br />
}<br />
<br />
public void WakeUp()<br />
{<br />
lock(myLock)<br />
{<br />
Monitor.Pulse(myLock);<br />
}<br />
}<br />
}<br />
|
|
|
|
|
I am developing an windows application in which i have to calculate check digit...
For Example:
Data to be encoded is "21435".
encode: 2 1 4 3 5
Weighting: 5 4 3 2 1
-----------------------------------
Totals: 10 4 12 6 5
-----------------------------------
Then add them: 10 + 4 + 12 + 6 + 5 = 37
Next divide the total by 11 and get the remainder which is 37/11 = 3 remainder 4. The remainder is the check character.
To type encoding the data 21435 that can be scanned, print (214354).
How can i do this check digit calculation on every keypress event of textbox.......
Help me in getting solution.....................
|
|
|
|
|
So you want us to code an application in stead of trying yourself and then ask for hint if you really can't figure out what's wrong?
Maybe you should give it a shot...
|
|
|
|
|
Hi All,
I am working on FTP uitility using C#. I have build a class for that using C#. But while uploading the file on FTP i am unable to upload whole file on the FTP. Only part of that file is uploaded. I have used the following code to upload the file.
--------------------------------------------------------------------------
public void UploadData(string FTPUri, string FilePath, string FileName, string UserName, string Password)
{
FtpWebRequest reqFTP;
reqFTP = (FtpWebRequest)FtpWebRequest.Create(FTPUri+FileName);
reqFTP.Method = WebRequestMethods.Ftp.UploadFile;
reqFTP.UseBinary = true;
reqFTP.Credentials = new NetworkCredential(UserName, Password);
StreamReader ReadStream = new StreamReader(FilePath);
string ftpResponse = ReadStream.ReadToEnd();
ReadStream.Close();
reqFTP.ContentLength = ftpResponse.Length;
StreamWriter ftpStream = new StreamWriter(reqFTP.GetRequestStream());
ftpStream.WriteLine(ftpResponse);
ftpStream.Close();
ftpStream.Close();
}
--------------------------------------------------------------------------
Here i am able to upload only part of that file. Can anybody tell me what is the problem?
Thanking you.
Pravin
|
|
|
|
|
for getting full data without error use binary reader for uploading
like this
//FtpWebReq.Credentials = new NetworkCredential(userId, Password);
// FtpWebReq.Method = WebRequestMethods.Ftp.UploadFile;
//FtpWebReq.KeepAlive = false;
// FtpWebReq.UseBinary = true;
//FtpWebReq.ContentLength = FINFO.Length;
FileStream fsSource = new FileStream(fileName, FileMode.Open, FileAccess.Read);
BinaryReader binReader = new BinaryReader(fsSource);
Stream strm=null;
byte[] byteRead;
binReader.BaseStream.Seek(0, SeekOrigin.Begin);
long pos = 0, fLen = 0;
int buffLength = 2048;
int readSize = buffLength;
fLen = FINFO.Length;
try
{
strm = FtpWebReq.GetRequestStream();
while (binReader.BaseStream.Position < fLen)
{
pos = binReader.BaseStream.Position;
if (fLen - pos < buffLength)
readSize = (int)(fLen - pos);
byteRead = binReader.ReadBytes(readSize);
strm.Write(byteRead, 0, readSize);
}
binReader.Close();
strm.Close();
fsSource.Close();
}
|
|
|
|
|
I have developed a Windows Application which embeds "WebBrowser" Control. by default i have loaded one aspx page (which contains one server side button) into the browser. I want to invoke a Click method of this button (not manually) and pass arguments to the button click event. I have used the below code to pass arguments:
HtmlDocument doc = webBrowser1.Document;
HtmlElement btnTemp = doc.GetElementById("btnSubmit");
Object[] args = { "data1", "data2" };
btnTemp.InvokeMember("Click", args);
but i was not able to get these values in my aspx page.
i have also tried the below code:
Object[] args = { "data1", "data2" };
doc.InvokeScript("__doPostBack('btnSubmit',args)");
here is the code for my aspx page:
protected void btnSubmit_Click(object sender, EventArgs e)
{
Object[] args = new Object[] { e };
if (args != null)
Response.Write(args[0].ToString());
}
Can anyone can help me out how to get these values from my aspx page.
|
|
|
|
|
hi
i have to add the gif file into to datagrid.
i was very new to vc++ dotnet application. i tried to load gif file like bitmap file, it display the image not the action in the file.
how do i import gif file into datagrid??
thanks in adv
shivapalanirajan k.
iam a software engineer working for varisis technologies bangalore
|
|
|
|
|
I'm looking to develop a c# basic wireless remote control with an input screen that sends and receives signals to and from a pc. For a simple example of what I mean, click here.
I've been a c# software developer for 5 years now however I've never delved into the realm of hardware and electronics. Does anyone know of any books or online tutorials I can reference to point me in the right direction towards building something like this?
Thanks.
-Goalie35
|
|
|
|
|
... and I'm not afraid to admit. I thought I understood how they work but I guess I was wrong. So can you tell me if my understanding is correct.
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);<br />
s.Bind(new IPEndPoint(IPAddress.Parse("192.168.1.3"), 37));<br />
I don't have a problem with that, I understand protocols.
s.Listen(6); This means that the socket lets 6 clients connect to this socket to establish a connection. This socket isn't actually used to send/receive data (except under the surface).
This is the OnAccept Callback:
<br />
public void Accept(IAsyncResult ar)<br />
{<br />
Socket new_socket = s.EndAccept(ar);<br />
<br />
s.BeginAccept(new AsyncCallback(Accept), s);<br />
}<br />
s.EndAccept (ar) returns a new socket which you would use as a connection between host and client. new_socket and s are two seperate sockets. s.BeginAccept(new AsyncCallback(Accept), s) then tells the socket to begin accepting a new client. Now when I want to disconnect the host would do:
new_socket.BeginDisconnect(false, new AsyncCallback(OnDisconnect), s);
But I don't know what to do in the callback. I know there is Shutdown and Disconnect but I don't know where and on which end to do this.
Any helps would be greatly appreciated.
|
|
|
|
|
Hi,
Was wondering if anyone could recommend useful objects that could be used to programmatically compare two files/strings visually using dot net. {i.e.?? Using two grid controls that move in sync with each other?? - if possible}
Looking for useful places to look objects that could implement something similar to windiff/winmerge functionality... Highlighting differences quickly.
Just wondering where to start and if there are Addins etc that could programmatically do this..
If anyone has any information that would be great.
Regards
di
|
|
|
|
|
Hi,
I am getting the below error and am very confused. Firstly, the error is telling me i cant convert an object into the same object, WHAT?!
Object of type 'ConceptualGraph.Edge.IEdge[]' cannot be converted to type 'ConceptualGraph.Edge.IEdge[]'.
I get the error when trying to view a form in VS design mode which has a control on it. The only instance of an Edge[] is a generic List of IEdges i have in the control which just adds a new item to it or removes it.
Any ideas whats going off?
Regards,
Gareth.
|
|
|
|
|
A wild guess is that the Designer is interfacing with your custom controls IEdge member in some default way that it doesn't support like returning an Array. You probably have to provide an interface the Designer can use or maybe just make it private so the Designer ignores it, that all depends on your intended use of the IEdge List.
No way to be sure from what you posted but something in that general area.
led mike
|
|
|
|
|
I need some help. I can't seem to get my onclick event to fire when I render my buttons using ".RenderControl". Can somebody tell me what I need to do to get this to work. Thanks
<br />
public override void Render(HtmlTextWriter writer)<br />
{<br />
LoadSearchLibraryTitle(libraryID,writer);<br />
LoadSearchFields(libraryID,writer); <br />
}<br />
<br />
protected void LoadSearchFields (int libraryID, HtmlTextWriter htmlWriter)<br />
{ <br />
int fieldCounter = 0;<br />
<br />
SPFieldCollection listFieldCollection = listCaml.GetPropertiesOfDocumentLibrary(libraryID);<br />
<br />
htmlWriter.Write(@"<div style=""text-align:left"">");<br />
htmlWriter.WriteBreak();<br />
htmlWriter.Write("<table width='100%'>");<br />
htmlWriter.WriteBreak();<br />
htmlWriter.Write("<tr>");<br />
htmlWriter.WriteBreak();<br />
<br />
foreach (SPField listField in listFieldCollection)<br />
{<br />
if (!listCaml.IsHiddenField(listField.InternalName, ListGlobals.hiddenLibrarySearchField))<br />
{ <br />
htmlWriter.Write(@"<td style=""width: 20%; text-align:right;"">");<br />
<br />
Label label = new Label();<br />
label.Text = listField.Title + ":";<br />
<br />
label.RenderControl(htmlWriter);<br />
htmlWriter.Write("</td>");<br />
<br />
htmlWriter.Write("<td>");<br />
TextBox textBox = new TextBox(); <br />
textBox.MaxLength = Convert.ToInt16(listField.DisplaySize);<br />
textBox.ID = listField.InternalName;<br />
textBox.Text = listField.InternalName;<br />
<br />
<br />
<br />
textBox.RenderControl(htmlWriter); <br />
htmlWriter.Write("</td>");<br />
<br />
fieldCounter++;<br />
<br />
if (listFieldCollection.Count > 10)<br />
{<br />
if (fieldCounter == 2)<br />
{<br />
htmlWriter.Write("</tr>");<br />
htmlWriter.Write("<tr>");<br />
fieldCounter = 0;<br />
}<br />
}<br />
else<br />
{<br />
htmlWriter.Write("</tr>");<br />
}<br />
} <br />
}<br />
<br />
htmlWriter.Write("<tr>");<br />
htmlWriter.Write(@"<td style=""width: 20%; text-align:right;"">");<br />
htmlWriter.Write("</td>");<br />
htmlWriter.Write("<td>");<br />
<br />
LoadSearchButtons(htmlWriter);<br />
<br />
htmlWriter.Write("</td>");<br />
htmlWriter.Write("</tr>");<br />
<br />
htmlWriter.Write("</table>");<br />
htmlWriter.Write("</div>"); <br />
}<br />
<br />
protected void LoadSearchButtons(HtmlTextWriter htmlWriter)<br />
{<br />
searchButton = new Button();<br />
searchButton.Text = "Search";<br />
searchButton.RenderControl(htmlWriter);<br />
<br />
htmlWriter.Write(" ");<br />
<br />
resetButton = new Button();<br />
resetButton.Text = "Reset"; <br />
<br />
<br />
this.searchButton.Click += new EventHandler(searchButton_Click); <br />
this.resetButton.Click += new EventHandler(resetButton_Click);<br />
this.Controls.Add(resetButton);<br />
resetButton.RenderControl(htmlWriter);<br />
<br />
}<br />
<br />
protected void resetButton_Click(object sender, System.EventArgs e)* This won't fire when I us RenderControl.<br />
{ <br />
foreach (Control controls in this.Controls)<br />
{ <br />
if (controls is TextBox)<br />
{<br />
TextBox textBox = (TextBox)controls;<br />
textBox.Text = "";<br />
} <br />
}<br />
}<br />
<br />
protected void searchButton_Click(object sender, System.EventArgs e)* This won't fire when I us RenderControl.<br />
<br />
{ <br />
Server.Transfer(@"/LibrarySearch/ProcessingSearch.aspx");<br />
} <br />
<br />
<br />
<br />
<br />
|
|
|
|
|
Postback events are matched to their corresponding control and handler after Load and before LoadComplete . In order for your control to receive an event, it must be created, placed in the control tree (in the same naming container hierarchy), and have the event handler registered by the end of the Load portion of the page life cycle. Since your button does not get created until the page is in its Render state, it will never receive an event.
Hope that helps.
PS- You may want to consider posting these types of questions in the ASP.NET forum in the future.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|