Search Results

Search found 12 results on 1 pages for 'kornelijepetak'.

Page 1/1 | 1 

  • [Word2007] How to showing "only number" in picture cross-reference

    - by kornelijepetak
    I have many pictures in a document and I reference them very often in text. I don't want to lose the order so I am using Insert - Cross-reference. This opens the cross-reference dialog where I can set Reference type to Picture. For "Insert reference to", there are 5 choices: - Entire caption - List item - Only label and number - Only caption text - Page number, Above/below What I need is a reference that would be inserted like this: [4], and not like this: [Picture 4]; None of these options enable me to do it. Is there any way to make Word 2007 insert a reference to only Caption Number? Note: The document is written in Croatian language which has 7 declension cases, so using "Picture 4" would not be valid in all cases. Actually caption label Picture is set to croatian word "Slika" and when I need to say say "in the picture" I can't because it would be "na Slici 5." and not "na Slika 5." (like Word would make me do). That's why I need to reference only the caption number. Is that possible in Word 2007?

    Read the article

  • How does Router know where to forward packet

    - by kornelijepetak
    If several computers with local addresses (192.168.0.#) are connected to a router and each computer opens a web browser and requests a page over HTTP, when these TCP:80 packets are sent out, the router switches the local address with the static IP of the router (i.e. Provider given IP) so the server can reply to the appropriate address. But how does the router know to which computer to forward the HTTP reply, since the TCP header does not contain the local IP address (does it?), and all computers are using port 80? Does this have anything to do with the MAC addresses? How exactly does this work?

    Read the article

  • How to show "only number" in picture cross-reference in Word 2007 document?

    - by kornelijepetak
    I have many pictures in a document and I reference them very often in text. I don't want to lose the order so I am using Insert - Cross-reference. This opens the cross-reference dialog where I can set Reference type to Picture. For "Insert reference to", there are 5 choices: - Entire caption - Only label and number - Only caption text - Page number - Above/below What I need is a reference that would be inserted like this: [4], and not like this: [Picture 4]; None of these options enable me to do it. Is there any way to make Word 2007 insert a reference to only Caption Number? Note: The document is written in Croatian language which has 7 declension cases, so using "Picture 4" would not be valid in all cases. Actually caption label Picture is set to croatian word "Slika" and when I need to say say "in the picture" I can't because it would be "na Slici 5." and not "na Slika 5." (like Word would make me do). That's why I need to reference only the caption number. Is that possible in Word 2007?

    Read the article

  • [WPF] ComboBox Style problems with DisplayMemberPath

    - by kornelijepetak
    I have a ComboBox and I have set the combo.ItemsSource property to a List object. The Book class contains two properties: "Abbreviation" and "Name". I have set the ComboBox's DisplayMemberPath to "Abbreviation" but the following style that is set on the ComboBox does not display the Abbreviation property, but instead shows "Words.Book" which is the name of the class. The ComboBox drop-down displays a list correctly (Using the specified Abbreviation property). The problem is in the selected ComboBox item, the one displayed when the ComboBox' drop-down is closed. I guess the problem is in ContentPresenter in DataTemplate but I was unable to find a successful solution. Currently the ContentPresenter's Content property is set to Content="{TemplateBinding Content} but I don't know if that's how it should be. Any ideas how to show the property specified in DisplayMemberPath on the selected item? Thank you the code: <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="ToggleButton"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition Width="20" /> </Grid.ColumnDefinitions> <Border x:Name="Border" Grid.ColumnSpan="2" CornerRadius="2" BorderThickness="1" Background="{DynamicResource ribbonTitleFade}" /> <Border Grid.Column="0" CornerRadius="2,0,0,2" Margin="1,6,1,6" BorderBrush="{DynamicResource boSecE}" BorderThickness="0,0,1,0" /> <Path x:Name="Arrow" Grid.Column="1" Fill="White" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 4 4 L 8 0 Z" /> </Grid> <ControlTemplate.Triggers> <Trigger Property="ToggleButton.IsMouseOver" Value="true"> <Setter TargetName="Border" Property="Background" Value="{DynamicResource ribbonTitleFade}" /> </Trigger> <Trigger Property="ToggleButton.IsChecked" Value="true"> <Setter TargetName="Border" Property="Background" Value="{DynamicResource ribbonTitleFade}" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="Border" Property="Background" Value="Black" /> <Setter TargetName="Border" Property="BorderBrush" Value="Black" /> <Setter Property="Foreground" Value="Gray"/> <Setter TargetName="Arrow" Property="Fill" Value="Gray" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> <Style x:Key="comboBoxBorderTransparent" TargetType="Control"> <Setter Property="BorderBrush" Value="{DynamicResource boPrimC}" /> </Style> <Style x:Key="comboItemStyle" TargetType="ComboBoxItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ComboBoxItem}"> <Border x:Name="backBorder" > <StackPanel Orientation="Horizontal"> <Rectangle x:Name="rectA" Stroke="White" Width="4" Height="4" Fill="#80FFFFFF" Margin="5,0,0,0" HorizontalAlignment="Left" /> <TextBlock x:Name="text" Foreground="White" FontSize="10px"> <ContentPresenter Margin="8,1,0,1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> </TextBlock> </StackPanel> </Border> <ControlTemplate.Triggers> <Trigger Property="ComboBoxItem.IsMouseOver" Value="true"> <Setter TargetName="rectA" Property="Stroke" Value="Black" /> <Setter TargetName="rectA" Property="Fill" Value="#80000000" /> <Setter TargetName="backBorder" Property="Background" Value="White"/> <Setter TargetName="text" Property="Foreground" Value="{DynamicResource boPrimC}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <DataTemplate x:Key="comboSelectedItemTemplate"> <TextBlock Foreground="White" FontSize="10px"> <ContentPresenter Content="{TemplateBinding Content}" /> </TextBlock> </DataTemplate> <Style TargetType="ComboBox"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.CanContentScroll" Value="true"/> <Setter Property="MinWidth" Value="60"/> <Setter Property="MinHeight" Value="20"/> <Setter Property="ItemContainerStyle" Value="{DynamicResource comboItemStyle}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ComboBox"> <Grid> <ToggleButton Name="ToggleButton" Grid.Column="2" Template="{StaticResource ComboBoxToggleButton}" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"> </ToggleButton> <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Name="ContentSite" IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{DynamicResource comboSelectedItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Margin="3,3,23,3" /> <Popup Name="Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="False" Focusable="False" PopupAnimation="Slide"> <Grid Name="DropDown" SnapsToDevicePixels="True" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}"> <Border x:Name="DropDownBorder" Background="{DynamicResource ribbonTitleFade}" BorderThickness="1" BorderBrush="{DynamicResource boPrimC}" /> <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True"> <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" /> </ScrollViewer> </Grid> </Popup> </Grid> <ControlTemplate.Triggers> <Trigger Property="HasItems" Value="false"> <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="Black"/> </Trigger> <Trigger Property="IsGrouping" Value="true"> <Setter Property="ScrollViewer.CanContentScroll" Value="false"/> </Trigger> <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true"> <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="2"/> <Setter TargetName="DropDownBorder" Property="Margin" Value="0"/> </Trigger> <Trigger Property="IsEditable" Value="true"> <Setter Property="IsTabStop" Value="false"/> <!--<Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>--> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> </Style.Triggers> </Style>

    Read the article

  • Right way to dispose Image/Bitmap and PictureBox

    - by kornelijepetak
    I am trying to develop a Windows Mobile 6 (in WF/C#) application. There is only one form and on the form there is only a PictureBox object. On it I draw all desired controls or whatever I want. There are two things I am doing. Drawing custom shapes and loading bitmaps from .png files. The next line locks the file when loading (which is an undesired scenario): Bitmap bmp = new Bitmap("file.png"); So I am using another way to load bitmap. public static Bitmap LoadBitmap(string path) { using (Bitmap original = new Bitmap(path)) { return new Bitmap(original); } } This is I guess much slower, but I don't know any better way to load an image, while quickly releasing the file lock. Now, when drawing an image there is method that I use: public void Draw() { Bitmap bmp = new Bitmap(240,320); Graphics g = Graphics.FromImage(bmp); // draw something with Graphics here. g.Clear(Color.Black); g.DrawImage(Images.CloseIcon, 16, 48); g.DrawImage(Images.RefreshIcon, 46, 48); g.FillRectangle(new SolidBrush(Color.Black), 0, 100, 240, 103); pictureBox.Image = bmp; } This however seems to be some kind of a memory leak. And if I keep doing it for too long, the application eventually crashes. Therefor, I have X questions: 1.) What is the better way for loading bitmaps from files without locking the file? 2.) What objects needs to be manually disposed in the Draw() function (and in which order) so there's no memory leak and no ObjectDisposedException throwing? 3.) If pictureBox.Image is set to bmp, like in the last line of the code, would pictureBox.Image.Dispose() dispose only resources related to maintaining the pictureBox.Image or the underlying Bitmap set to it?

    Read the article

  • Using string constants in implicit conversion

    - by kornelijepetak
    Consider the following code: public class TextType { public TextType(String text) { underlyingString = text; } public static implicit operator String(TextType text) { return text.underlyingString; } private String underlyingString; } TextType text = new TextType("Something"); String str = text; // This is OK. But I want to be able do the following, if possible. TextType textFromStringConstant = "SomeOtherText"; I can't extend the String class with the TextType implicit operator overload, but is there any way to assign a literal string to another class (which is handled by a method or something)? String is a reference type so when they developed C# they obviously had to use some way to get a string literal to the class. I just hope it's not hardcoded into the language.

    Read the article

  • Retrieve default camera video extension from Windows Mobile

    - by kornelijepetak
    Is there any way to find out what is the default video extension for camera application? I am using CameraCaptureDialog to make the user use the camera and save the image to a specific file which then I consume in the application. However, there is a problem with the videos. Emulator gives .wmv video file while some devices I've been testing save to mp4 format. Is there any reliable way to find out what is the format in which the phone that is running the application saves the file?

    Read the article

  • What is faster with PictureBox? Many small redraws or complete redraw.

    - by kornelijepetak
    I have a PictureBox (WinMobile 6 WinForm) on which I draw some images. There is a background image that goes in the background and it does not change. However objects that are drawn on the picturebox are moving during the application so I need to refresh the background. Since items that are redrawn fill from 50% to 80% of the surface, the question is which of the two is faster: 1) Redraw only parts of the background image that have been changed (previous+next location of the moving object). 2) Redraw complete background and then draw all the objects in their current position. Now, the reason for asking is because I am not sure how much of processor power is needed for a single drawImage operation and what are the time consuming factors. I am aware if there is almost complete coverage of the background, it would be stupid to redraw portions of it, because by drawing portions I will have drawn the complete picture. But since sometimes only half of the image had changed (some objects remained in their old position), it may (perhaps) be benefitial to redraw only those regions. But I need your insight on this... Thanks.

    Read the article

  • How to check whether the form has any ShowDialog() forms open?

    - by kornelijepetak
    I have a form MainForm with several properties/methods that are accessed from another thread. At some point I might open a form AuxForm with ShowDialog() and then while that modal form is open, the other thread still modifies the MainForm's properties. This is all desired. In one of the methods accessed from another thread I need to execute some code, but only if the modal AuxForm is not open. Is there any way to check this (by using .NET WF Form properties) or I need to use a flag variable? NOTE: None of these properties/methods modify the controls (so no Invoke is required).

    Read the article

  • [WM6] Owner of a component. What exactly is this for?

    - by kornelijepetak
    I am developing an app for Windows Mobile 6 and there is a CameraCaptureDialog class that enables me to call a camera app from my own application. The class has an Owner property that most examples on the internet set to "this". cam.Owner = this; What exactly does this do? I've seen a similar scenario with Windows Forms components/controls by setting the Parent control. In that case I guess it's used only for layout algorithms, but other than that, is there any useful purpose? I don't see how setting an owner of the CameraCaptureDialog can (and actually does not) make any difference (at least not a visible one). Any insight would be appreciated.

    Read the article

  • Web service performing asynchronous call

    - by kornelijepetak
    I have a webservice method FetchNumber() that fetches a number from a database and then returns it to the caller. But just before it returns the number to the caller, it needs to send this number to another service so instantiates and runs the BackgroundWorker whose job is to send this number to another service. public class FetchingNumberService : System.Web.Services.WebService { [WebMethod] public int FetchNumber() { int value = Database.GetNumber(); AsyncUpdateNumber async = new AsyncUpdateNumber(value); return value; } } public class AsyncUpdateNumber { public AsyncUpdateNumber(int number) { sendingNumber = number; worker = new BackgroundWorker(); worker.DoWork += asynchronousCall; worker.RunWorkerAsync(); } private void asynchronousCall(object sender, DoWorkEventArgs e) { // Sending a number to a service (which is Synchronous) here } private int sendingNumber; private BackgroundWorker worker; } I don't want to block the web service (FetchNumber()) while sending this number to another service, because it can take a long time and the caller does not care about sending the number to another service. Caller expects this to return as soon as possible. FetchNumber() makes the background worker and runs it, then finishes (while worker is running in the background thread). I don't need any progress report or return value from the background worker. It's more of a fire-and-forget concept. My question is this. Since the web service object is instantiated per method call, what happens when the called method (FetchNumber() in this case) is finished, while the background worker it instatiated and ran is still running? What happens to the background thread? When does GC collect the service object? Does this prevent the background thread from executing correctly to the end? Are there any other side-effects on the background thread? Thanks for any input.

    Read the article

  • [AS3] Calling Php Script with UTF-8 POST variables

    - by kornelijepetak
    AS3 documentation says that Strings in AS3 are in UTF-16 format. There is a textbox on a Flash Clip where user can type some data. When a button is clicked, I want this data to be sent to a php script. I have everything set up, but it seems that the PHP script gets the data in UTF-16 format. The data in the database (which is utf-8) shows some unrecognizable characters (where special characters are used), meaning that the data has not been sent in a correct encoding. var variables:URLVariables=new URLVariables; var varSend:URLRequest=new URLRequest("http://website.com/systematic/accept.php"); varSend.method=URLRequestMethod.POST; varSend.data=variables; var varLoader:URLLoader=new URLLoader; varLoader.dataFormat=URLLoaderDataFormat.VARIABLES; varLoader.addEventListener(Event.COMPLETE, completeHandler); When submit button is clicked, the following handler gets executed. function sendData(event:MouseEvent) : void { // i guess here is the problem (tbName.text is UTF-16) variables.name = tbName.text; varLoader.load(varSend); } Is there any way to send the data so that PHP script gets the data in UTF-8 format? (PHP script is retrieving the value using the $_POST['name']).

    Read the article

1