Search Results

Search found 87 results on 4 pages for 'serhio'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Preserve Font Size when scaling a Drawing

    - by serhio
    I do the following when drawing: Matrix m = new Matrix() m.Scale(_zoom, _zoom) e.Graphics.Transform = m e.Graphics.DrawLine(...) ' line representation e.Graphics.DrawString(...) ' line text Now, the text became also scaled. Is it possible to avoid it?

    Read the article

  • Preview a .NET color

    - by serhio
    The VS debugger gives me: _Color = "{Name=ff000040, ARGB=(255, 0, 0, 64)}" how can I "see" what color is? I tried a html page: <html> <div style="background: rgba(255, 0, 0, 64);">________<div> <h1 style="background-color: ff000040">hello</h1> </html> doesn't work.

    Read the article

  • php slideshow sample

    - by serhio
    I try to do a simple image slideshow in php (just cycle images, no links, no other effects). after some googling I found the following in net: <HTML> <HEAD> <TITLE>Php Slideshow</TITLE> <script language="javascript"> var speed = 4000; // time picture is displayed var delay = 3; // time it takes to blend to the next picture x = new Array; var y = 0; <?php $tel=0; $tst='.jpg'; $p= "./images"; $d = dir($p); $first = NULL; while (false !== ($entry = $d->read())) { if (stristr ($entry, $tst)) { $entry = $d->path."/".$entry; print ("x[$tel]='$entry';\n"); if ($first == NULL) { $first = $entry; } $tel++; } } $d->close(); ?> function show() { document.all.pic.filters.blendTrans.Apply(); document.all.pic.src = x[y++]; document.all.pic.filters.blendTrans.Play(delay); if (y > x.length - 1) y = 0; } function timeF() { setTimeout(show, speed); } </script> </HEAD> <BODY > <!-- add html code here --> <?php print ("<IMG src='$first' id='pic' onload='timeF()' style='filter:blendTrans()' >"); ?> <!-- add html code here --> </BODY> </HTML> but it displays only the first image from the cycle. Do I something wrong? the resulting HTML page is: <HTML> <HEAD> <TITLE>Php Slideshow</TITLE> <script language="javascript"> var speed = 4000; // time picture is displayed var delay = 3; // time it takes to blend to the next picture x = new Array; var y = 0; x[0]='./images/under_construction.jpg'; x[1]='./images/BuildingBanner.jpg'; x[2]='./images/littleLift.jpg'; x[3]='./images/msfp_smbus1_01.jpg'; x[4]='./images/escalator.jpg'; function show() { document.all.pic.filters.blendTrans.Apply(); document.all.pic.src = x[y++]; document.all.pic.filters.blendTrans.Play(delay); if (y > x.length - 1) y = 0; } function timeF() { setTimeout(show, speed); } </script> </HEAD> <BODY > <!-- add html code here --> <IMG src='./images/under_construction.jpg' id='pic' onload='timeF()' style='filter:blendTrans()' ><!-- add html code here --> </BODY> </HTML>

    Read the article

  • Help repaiting a Component

    - by serhio
    I am working with Microsoft.VisualBasic.PowerPacks.RectangleShape, but the question is common for components or controls in general. I added to a TextRectangleShape : RectangleShape a Text property: Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) MyBase.OnPaint(e) Dim f As Font = Me.Font Dim g As Graphics = e.Graphics Dim textRect As Rectangle = New Rectangle(Me.Location, Me.Size) Using br As New SolidBrush(Me._TextColor) g.DrawString(_Text, f, br, textRect) End Using End Sub Now when I move this control the text does not disappear from the former location. Maybe I could invalidate each time the Parent in the OnPaint, but if this is not a good solution if the parent has a time consuming repaint logic or I have a lot of my custom component moving at the same time. How do I properly repaint the component?

    Read the article

  • some unclear php "symbolics"

    - by serhio
    I am a php beginner and seed on the forum such a php expression: $regex = <<<'END' / ( [\x00-\x7F] # single-byte sequences 0xxxxxxx | [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx | [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2 | [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3 ) | ( [\x80-\xBF] ) # invalid byte in range 10000000 - 10111111 | ( [\xC0-\xFF] ) # invalid byte in range 11000000 - 11111111 /x END; is this code correct? what should mean some strange (4 me) constructions like <<< 'END' / /x and END; thanks

    Read the article

  • Force exceptions language in English

    - by serhio
    My Visual Studio 2005 is a French one, installed on a French OS. All the exceptions I receive during debug or runtime I obtain also in French. Can I however do something that the exceptions messages be in English? For goggling, discussing etc. I tried the following: Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); throw new NullReferenceException(); obtained Object reference not set to an instance of an object. This is, surely, cool... but, as I work on a French project, I will not hardcode forcing Thread.CurrentUICulture to English. I want the English change to be only on my local machine, and don't change the project properties. Is it possible to set the exceptions language without modifying the code of the application? In VS 2008, set the Tools - Options - Environment - International Settings - Language to "English" wnd throwing the same exception obtain the ex message en French, however:

    Read the article

  • Form.GetChildsAtPoint

    - by serhio
    I would like to obtain the list of controls under a given point. There is a method on System.Windows.Form to obtain a control under a point(GetChildAtPoint) but not point(GetChildsAtPoint). Is there something similar for the list of controls (if borders intersect one other): I need this because I select the objects when user clicks on the panel(I use Microsoft.VisualBasic.PowerPacks.RectangleShape as label bellow). In case if labels are superposed, user should be asked what object to select.

    Read the article

  • Help Repainting a Line

    - by serhio
    I am doing a custom control (inherited from VisualBasic.PowerPacks.LineShape), that should be painted like as standard one, but also having a Icon displayed near it. So, I just overrided OnPaint like this: protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { e.Graphics.DrawIcon(myIcon, StartPoint.X, StartPoint.Y); base.OnPaint(e); } Now, everything is OK, but when my control moves, the icon still remains drawn on the ancient place. Is there a way to paint it properly? The sample code for tests using Microsoft.VisualBasic.PowerPacks; using System.Windows.Forms; using System.Drawing; namespace LineShapeTest { /// /// Test Form /// public class Form1 : Form { IconLineShape myLine = new IconLineShape(); ShapeContainer shapeContainer1 = new ShapeContainer(); Panel panel1 = new Panel(); public Form1() { this.panel1.Dock = DockStyle.Fill; // load your back image here this.panel1.BackgroundImage = global::WindowsApplication22.Properties.Resources._13820t; this.panel1.Controls.Add(shapeContainer1); this.myLine.StartPoint = new Point(20, 30); this.myLine.EndPoint = new Point(80, 120); this.myLine.Parent = this.shapeContainer1; MouseEventHandler panelMouseMove = new MouseEventHandler(this.panel1_MouseMove); this.panel1.MouseMove += panelMouseMove; this.shapeContainer1.MouseMove += panelMouseMove; this.Controls.Add(panel1); } private void panel1_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { myLine.StartPoint = e.Location; } } } /// /// Test LineShape /// public class IconLineShape : LineShape { Icon myIcon = SystemIcons.Exclamation; protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { e.Graphics.DrawIcon(myIcon, StartPoint.X, StartPoint.Y); base.OnPaint(e); } } } Nota Bene, for the lineShape: Parent = ShapeContainer Parent.Parent = Panel Update 1 TRACES In this variant of OnPaint, we have traces: protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Graphics g = Parent.Parent.CreateGraphics(); g.DrawIcon(myIcon, StartPoint.X, StartPoint.Y); base.OnPaint(e); } Update 2 BLINKS In this variant of OnPaint, we have a blinking image: protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Parent.Parent.Invalidate(this.Region, true); Graphics g = Parent.Parent.CreateGraphics(); g.DrawIcon(myIcon, StartPoint.X, StartPoint.Y); base.OnPaint(e); } Update 3: External Invalidation This variant works well, but... from exterior of IconLineShape class: private void panel1_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { Region r = myLine.Region; myLine.StartPoint = e.Location; panel1.Invalidate(r); } } /// /// Test LineShape /// public class IconLineShape : LineShape { Icon myIcon = SystemIcons.Exclamation; Graphics parentGraphics; protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { parentGraphics.DrawIcon(myIcon, StartPoint.X, StartPoint.Y); base.OnPaint(e); } protected override void OnParentChanged(System.EventArgs e) { // Parent is a ShapeContainer // Parent.Parent is a Panel parentGraphics = Parent.Parent.CreateGraphics(); base.OnParentChanged(e); } } Even this resolves the problem of the test example, I need this control to be done inside the control, because I can't force the external "clients" of this control do not forget to save the old region and invalidate the parent each time changing a location...

    Read the article

  • Some unclear PHP syntax

    - by serhio
    I am a PHP beginner and saw on the forum this PHP expression: $regex = <<<'END' / ( [\x00-\x7F] # single-byte sequences 0xxxxxxx | [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx | [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2 | [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3 ) | ( [\x80-\xBF] ) # invalid byte in range 10000000 - 10111111 | ( [\xC0-\xFF] ) # invalid byte in range 11000000 - 11111111 /x END; Is this code correct? What do these strange (for me) constructions like <<<, 'END', /, /x, and END; mean? I recieve: Parse error: syntax error, unexpected T_SL in /home/vhosts/mysite.com/public_html/mypage.php on line X Thanks

    Read the article

  • Correctly include php header in all pages

    - by serhio
    I would include a php header (mysite.com/header.php) in all the pages from a site. How to do it properly? There are relative links: <?php include_once 'header.php'; ?> <?php include_once '../header.php'; ?> And this didn't help: <?php include_once '/header.php'; ?>

    Read the article

  • Does PHP Try Catch freezes the page?

    - by serhio
    I have the following code function displaySomeFeeds($urls, $keywords = NULL) { error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE); echo "<ul>"; foreach ($urls as $url) { try { displayFeed($url, $keywords, NULL, false); } catch(Exception $e) { //echo "Error when obtaining news from '$url': " .$e->getMessage(); } } echo "</ul>"; } When I use it with Try Catch, the pages loads very, very, very slow. When I use it without Try/Catch the pages loads normally, but with error messages. Could I ammeliorate the time of response with Try/Catch?

    Read the article

  • Fill a FlowLayoutPanel

    - by serhio
    I have a UserControl in which a FlowLayoutPanel. This user control consist of a description and some controls: [descr.] 123456789, it should be able to be reversed 987654321 [descr.] So FlowLayoutPanel is used for this scope(RightToLeft - True/False). Is this a way that the label1 fill the rest of the control(to left or right respectively)?

    Read the article

  • Shadows vs Overloads in VB.NET

    - by serhio
    When we have new in C#, that personally I see only as a workaround to override a property that does not have a virtual/overridable declaration, in VB.NET we have two "concepts" Shadows and Overloads. In which case prefer one to another?

    Read the article

  • Serialize Forms into memory

    - by serhio
    Background: In a desktop MDI application we have a lot of forms. Task: Save the controls contents of closed forms(textbox texts, checkbox checks etc). Limitations: A saved form for (DB/Windows) user? For (DB/Windows) group of users? Both variants may be possible. Question: a) What is the best way? b) if I want do not use files, how to serialize the form into a MemoryStream and then recuperate it if the opening form was been once opened and serialized? StartingPoint: Implemented a form that implements ISerializable. Deserialize the form on opening, serialize onclosing: Public Sub GetObjectData(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext) Implements System.Runtime.Serialization.ISerializable.GetObjectData info.AddValue("tbxExportFolder", tbxExportFolder.Text, GetType(String)) info.AddValue("cbxCheckAliasUnicity", cbxCheckAliasUnicity.Checked, GetType(Boolean)) End Sub Public Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext) Me.New() Me.tbxExportFolder.Text = info.GetString("tbxExportFolder") Me.cbxCheckAliasUnicity.Checked = info.GetBoolean("cbxCheckAliasUnicity") End Sub Private Sub SerializeMe() Dim binFormatter As New Formatters.Binary.BinaryFormatter Dim fileStream As New FileStream(SerializedFilename, FileMode.Create) Try binFormatter.Serialize(fileStream, Me) Catch Throw Finally fileStream.Close() End Try End Sub Protected Overrides Sub OnClosing(ByVal e As System.ComponentModel.CancelEventArgs) SerializeMe() MyBase.OnClosing(e) End Sub

    Read the article

  • Generic WithEvents

    - by serhio
    Error: 'WithEvents' variables can only be typed as classes, interfaces or type parameters with class constraints Background: Public Class Tadpole(Of T As IVisibleChanged, P As IVisibleChanged) Private WithEvents _Tad As T ' ERROR ' Private WithEvents _Pole As P ' ERROR ' Public Property Tad() As T ... Public Property Pole() As P ... End Class ''' IVisibleChanged ''' Public Interface IVisibleChanged Property Visible() As Boolean Event VisibleChanged As EventHandler End Interface Workaround: a. Use AddHandler to handle events defined in a structure. EDIT b. use Private WithEvents _Tad AsIVisibleChanged (M.A. Hanin) c. ?

    Read the article

  • Generic overriding tells me this is the same function. Not agree.

    - by serhio
    base class: Class List(Of T) Function Contains(ByVal value As T) As Boolean derived class: Class Bar : List(Of Exception) ' Exception type as example ' Function Contains(Of U)(ByVal value As U) As Boolean compiler tells me that that two are the same, so I need to declare Overloads/new this second function. But I want use U to differentiate the type (one logic) like NullReferenceException, ArgumentNull Exception, etc. but want to leave the base function(no differentiation by type - other logic) as well.

    Read the article

  • Events and references pattern

    - by serhio
    In a project I have the following relation between BO and GUI By e.g. G could represent a graphic with time lines, C a TimeLine curve, P - points of that curve and T the time that represents each point. Each GUI object is associated with the BO corresponding object. When T changes GUI P captures the Changed event and changes its location. So, when G should be modified, it modifies internally its objects and as result T changes, P moves and the GuiG visually changes, everything is OK. But there is an inconvenient of this architecture... BO should not be recreated, because this will breack the link between BO and GUIO. In particular, GUI P should always have the same reference of T. If in a business logic I do by e.g. P1.T = new T(this.T + 10) GUI_P1 will not move anymore, because it wait an event from the reference of former P1.T object, that does not belongs to P1 anymore. So the solution was to always modify the existing objects, not to recreate it. But here is an other inconvenient: performance. Say I have a ready newC object that should replace the older one. Instead of doing G1.C = newC I should do foreach T in foreach P in C replace with T from P from newC. Is there an other more optimal way to do it?

    Read the article

  • redirect an event in VB.NET

    - by serhio
    I havea a UserControl1 (in witch I have an Label1) in Form1. I want to catch the MouseDown event from label and send it like from UserControl I do: Public Class UserControl1 Shadows Custom Event MouseDown As MouseEventHandler AddHandler(ByVal value As MouseEventHandler) AddHandler Label1.MouseDown, value End AddHandler RemoveHandler(ByVal value As MouseEventHandler) RemoveHandler Label1.MouseDown, value End RemoveHandler RaiseEvent(ByVal sender As Object, ByVal e As MouseEventArgs) 'RaiseMouseEvent(Me, e) ??? ' End RaiseEvent End Event End Class However, when I set in the Form1 the UserControl Private Sub UserControl11_MouseDown(ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.MouseEventArgs) _ Handles UserControl11.MouseDown MessageBox.Show(sender.GetType.Name) 'here I have 'Label', want 'UserControl' End Sub

    Read the article

  • How to: generate UnhandledException?

    - by serhio
    I use this code to catch the WinForm application UnhandledException. [STAThread] static void Main(string[] args) { // Add the event handler for handling UI thread exceptions to the event. Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); // Set the unhandled exception mode to force all Windows Forms errors // to go through our handler. Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); // Add the event handler for handling non-UI thread exceptions to the event. AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); try { Application.Run(new MainForm()); } catch.... There I will try to restart the application. Now my problem is to simulate a exception like this. I tried before try (in main): throw new NullReferenceException("test"); VS caught it. Tried also in MainForm code with button : private void button1_Click(object sender, EventArgs ev) { ThreadPool.QueueUserWorkItem(new WaitCallback(TestMe), null); } protected void TestMe(object state) { string s = state.ToString(); } did not help, VS caught it, even in Release mode. How should I, finally, force the application generate UnhandleldException? Will I be able to restart the application in CurrentDomain_UnhandledException?

    Read the article

  • AWstats icon on the web site

    - by serhio
    I have a site that is analyzed by AWStats, and I am satisfied with the information its provides. Now, is there a way to display a little picture-icon with main AWstats(hits, etc) data on the web site page?

    Read the article

  • Dock=>Fill a control in FlowLayoutPanel

    - by serhio
    I have a UserControl in which a FlowLayoutPanel. This user control consist of a description and some controls: [descr.] 123456789, it should be able to be reversed 987654321 [descr.] So FlowLayoutPanel is used for this scope(RightToLeft - True/False). Is this a way that the label1 fill the rest of the control(to left or right respectively)?

    Read the article

  • ByRef vs ByVal generates errors!?

    - by serhio
    ByRef vs ByVal generates errors!? I had a method that used an Object Function Foo(ByRef bar as CustomObject) as Boolean this method generated errors, because some strange .NET Runtime things changed the bar object, causing its Dispose()al. A lot of time spent to understand the thing(where the ... object is changed), until somebody replaced ByRef by ByVal and object wasn't change anymore when passing to this method... Somebody could explain this, what happens?

    Read the article

  • Deployment project in VisualStudio: Is the output in Debug or Releaase mode?

    - by serhio
    I have a solution in Visual studio containing a winform project(WinProj) and a deployment project for WinProj. I added to the deployment project the primary output from WinProj. Does it be compiled in Debug or Release mode? I am asking because in the WinProj code I have conditional precompiler statements #if DEBUG throw; #endif will or not be considered this code in the setup project?

    Read the article

  • Any sense to set obj = null(Nothing) in Dispose()?

    - by serhio
    Is there any sense to set custom object to null(Nothing in VB.NET) in the Dispose() method? Could this prevent memory leaks or it's useless?! Let's consider two examples: public class Foo : IDisposable { private Bar bar; // standard custom .NET object public Foo(Bar bar) { this.bar = bar; } public void Dispose() { bar = null; // any sense? } } public class Foo : RichTextBox { // this could be also: GDI+, TCP socket, SQl Connection, other "heavy" object private Bitmap backImage; public Foo(Bitmap backImage) { this.backImage = backImage; } protected override void Dispose(bool disposing) { if (disposing) { backImage = null; // any sense? } } }

    Read the article

< Previous Page | 1 2 3 4  | Next Page >