Search Results

Search found 3 results on 1 pages for 'tolga'.

Page 1/1 | 1 

  • WinForms Dynamic Label

    - by tolga
    I am creating dynamic labels and letting users change attributes of the labes like backcolor and so by sending unicode. However I don't know how to check if the label exists therefore I can't manipulate the dynamicly created label. below is my code: if ((InputBox.Text.StartsWith("p")) && (InputBox.Text.EndsWith("}")))// only process if the message starts with p and ends with } { string Message = InputBox.Text; InputBox.Text = "";// Clear the box when done. // Butt1 message line if (Message.StartsWith("plabelt1")) { if (Message.StartsWith("plabelt1_BackColor")) { Message = Message.Substring(19); //labelt1.BackColor = System.Drawing.Color.FromName(Message.Replace("}", "")); } } private void ImageBox_DragDrop(object sender, DragEventArgs e) { //Graphics g = ImageBox.CreateGraphics(); //g.DrawImage((Image)e.Data.GetData(DataFormats.Bitmap), //new Point(e.X - this.Left, e.Y - this.Top - 150)); Point p2 = PointToClient(Cursor.Position); Label buttlbl_ = new Label(); labelCount++; buttlbl_.Name = "labelt" + labelCount.ToString(); buttlbl_.Location = new Point(p2.X, p2.Y); buttlbl_.Size = new System.Drawing.Size(37, 37); buttlbl_.BackColor = System.Drawing.Color.DarkGray; this.Controls.Add(buttlbl_); buttlbl_.BringToFront(); ImageBox.Invalidate(); } } Any suggestions?

    Read the article

  • DocumentCompleted event when the page is fully loaded in WebBrowser form (Windows Forms C#)

    - by Tolga E
    I use the DocumentCompleted but this gets fired multiple times. Now I've seen this example if (e.Url.AbsolutePath != this.webBrowser.Url.AbsolutePath) which is used to confirm that the requested file is completed loading but this gets fired before anything else (like images) on the page is loaded. Thus I'm still not able to tell when a webpage is fully loaded. Is there a way to ensure that the webpage has fully loaded and there's nothing being loaded?

    Read the article

  • c++ std::ostringstream vs std::string::append

    - by NickSoft
    In all examples that use some kind of buffering I see they use stream instead of string. How is std::ostringstream and << operator different than using string.append. Which one is faster and which one uses less resourses (memory). One difference I know is that you can output different types into output stream (like integer) rather than the limited types that string::append accepts. Here is an example: std::ostringstream os; os << "Content-Type: " << contentType << ";charset=" << charset << "\r\n"; std::string header = os.str(); vs std::string header("Content-Type: "); header.append(contentType); header.append(";charset="); header.append(charset); header.append("\r\n"); Obviously using stream is shorter, but I think append returns reference to the string so it can be written like this: std::string header("Content-Type: "); header.append(contentType) .append(";charset=") .append(charset) .append("\r\n"); And with output stream you can do: std::string content; ... os << "Content-Length: " << content.length() << "\r\n"; But what about memory usage and speed? Especially when used in a big loop. Update: To be more clear the question is: Which one should I use and why? Is there situations when one is preferred or the other? For performance and memory ... well I think benchmark is the only way since every implementation could be different. Update 2: Well I don't get clear idea what should I use from the answers which means that any of them will do the job, plus vector. Cubbi did nice benchmark with the addition of Dietmar Kühl that the biggest difference is construction of those objects. If you are looking for an answer you should check that too. I'll wait a bit more for other answers (look previous update) and if I don't get one I think I'll accept Tolga's answer because his suggestion to use vector is already done before which means vector should be less resource hungry.

    Read the article

1