w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Avoid scrolling to the top in TabControl
This happens due to the fact that once you select the richTextBox and it is "out of sight" it goes to the current position(which in your case is not visible or at the top). If you select the richTextBox first and then scroll you will avoid this. One way you can do this is to Select() the richTextBox on application start. Add this: private void Form1_Load(object sender, EventArgs e) { richTextBox1.Select(); } EDIT: You can also add the Select() on TabIndexChanged as the behavior will reoccur if you change Tabs.

Categories : C#

Issue with TabControl which ContentTemplate contains a TabControl
First, if you have one and only one item, why do you want a TabControl? If you just want to have an element with a header, you can do that in your ContentTemplate. In order to fix the issue you're seeing, however, have you tried setting SelectedIndex="0" on the ChildTabControl? That should force it to always be selected. EDIT for other possible solution Well, I was able to replicate this, but it only happens intermittently in my test. I think the easiest way you can fix this is to set the SelectedItem of the child TabControl to the ChildItemsSource: <TabControl Name="ChildTabControl" ItemsSource="{Binding ChildItemsSource, Converter={StaticResource ResourceKey=ItemToObservableCollectionConverter }}" SelectedItem="{Binding ChildItemsSource}" /> I have

Categories : Wpf

Nested Scrolling
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" > <ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/poicroll" > <RelativeLayout android:id="@+id/addLay" android:layout_width="match_parent" android:layout_height="490dp" android:paddingLeft="10dp"

Categories : Android

Nested UIScrollViews with horizontal scrolling for both
If the outer scrollView still animates movement, it will get all gestures instead of letting inner one handle them. You could try using gestureRecognizer's requireGestureRecognizerToFail: method, so that panGestureRecognizer of the outer scroll view requires panGestureRecognizers of the outer scrollViews to fail. It might make the scrolling feel a bit laggy, and I'm not sure if that'll solve your problem but hey, doesn't hurt to try.

Categories : IOS

calendarview stops scrolling when nested in scrolview in android
I've found answer to this problem here: http://stackoverflow.com/a/9687545 Basically you need to implement custom CalendarView and override onInterceptTouchEvent method. I did it as following: package com.example.app.views; public class CalendarViewScrollable extends CalendarView { public CalendarViewScrollable(Context context) { super(context); } public CalendarViewScrollable(Context context, AttributeSet attrs) { super(context, attrs); } public CalendarViewScrollable(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (ev.getActionMasked() == MotionEvent.ACTION_DOWN) { ViewParent

Categories : Android

VB.NET WinForm TabControl
Find a custom tab control that does all of this. Here's page with source code on customizing tab controls

Categories : Dotnet

How to restyle a TabControl in WPF
In this case, you will need to implement a Style / Template for TabControl to get this form. TabControl has three directions for the tabs are: central (default), left and right directions. You need to left direction, judging by picture. Style for TabItem (elements of TabControl) would be one in all directions. Style for TabControl with left direction: <Style x:Key="LeftTabControl" TargetType="{x:Type TabControl}"> <Setter Property="TabStripPlacement" Value="Left" /> <Setter Property="Margin" Value="0" /> <Setter Property="Padding" Value="0" /> <Setter Property="Background" Value="White" /> <Setter Property="BorderThickness" Value="1" /> <Setter Property="BorderBrush" Value="Transparent" />

Categories : Wpf

how to get Tabcontrol's Tab focus in WPF
You can make use of the TabControl.SelectionChanged Event void TabControl_TabSelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.Source is TabControl) { // do something } }

Categories : Wpf

TabControl flickering
You left out an important detail. This question strongly suggests you did more than you described, you are also overriding the CreateParams property in your form to turn on the WS_EX_COMPOSITED style flag for the window. It enables double-buffering for the form and all of its controls, a good way to suppress flicker in general. But it can have some detrimental side-effects. TabControl is in fact a trouble-maker, something messed up about the way it renders that is incompatible with WS_EX_COMPOSITED. Once too many tabs are added and the navigation buttons appear, it starts to constantly redraw itself. Perceived as rapid flicker. The native tab control renderer has lots of bugs, the Microsoft team that wrote it did a very lousy job. There is no known workaround for this bug, you'll h

Categories : C#

Tabcontrol Tab ItemDatabinding
I'm not sure DataTable implements the necessary notification mechanism to update the UI. From your code, I can suggest a simple alternative of creating a DataTable and adding data to it followed by setting the property "GridSource" . As per your existing code property changed is fired when you create a new DataTable and set it to "GridSource" at this time the DataTable is empty and UI is rendered accordingly. UPDATE my xaml code: <Window.Resources> <DataTemplate x:Key="DataTemplate1"> <Grid MinHeight="100"> <Grid.RowDefinitions> <RowDefinition Height="25"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Button Content="Add Row" Click="Button_Click" Grid.Ro

Categories : Wpf

Android - Horizontal Scrolling Views Inside Vertically Scrolling View
So for your first two views I would recommend you using HorizontalListView, then for other items, if they are always 6 squares in a row, create some simple LinearLayout with horizontal orientation and 6 inner views. As for the whole layout use ordinary ListView. There are really nothing special in using HorizontalListView inside ListView because they scroll on different axis, however in your adapter you would have to implement getItemViewType(int position) and getViewTypeCount(), because you have two different types of views in your layout, using this methods android knows what kind of views to supply for reuse in your convertView in getView(int position, View convertView, ViewGroup parent). And using this mechanism - view recycling would work perfectly, because it would create at most 2

Categories : Android

How to disable scrolling and re-enable scrolling on a mobile touch screen device
Try this code : var scroll = true $(document).bind('touchmove', function(){ scroll = false }).unbind('touchmove', function(){ scroll = true }) $(window).scroll(function() { if ($('button').is(':checked') && scroll == false) { $(document).scrollTop(0); } })

Categories : Javascript

jQuery animate (scrollTop) instantly scrolling to the top of the page and then scrolling down
The href="#" is causing the page to jump to the top. I would just get rid of the tag altogether inside the . You can use css :hover { cursor: pointer; } to get the same effect I am guessing you were going with by using the a tag.

Categories : Jquery

Scrolling issue in jquery mobile (div scroll ) while scrolling a page
You can put <div class="searchContend_h"> into a header section jsFiddle or simply add him position:fixed

Categories : Jquery

horizontal scrolling and vertical scrolling in site using mobile view only
I think that you can use @media query and overflow-x or overflow-y to control the scrollbars, so with that said you can combine this: CSS body { overflow: hidden; } @media (max-width: 480px) { body { overflow-y: auto; } } Adjust the 480px to meet your specific needs. Here is a fiddle that shows this query working when you resize the browser to lower than 480px you can see that the scrollbar comes back. Let me know if this works for you. As you can see we have the overflow set to hidden on the body (as you have now) and with this @media query I can bring it back when the width is 480px or lower.

Categories : Wordpress

Datagirdview and tabcontrol issue
Instead of doing: grdDistProcessing.Rows[0].DefaultCellStyle.BackColor = Color.BurlyWood; grdDistProcessing.Rows[0].DefaultCellStyle.ForeColor = Color.Black; Use the CellFormatting event (Display category) for grdDistProcessing, like this: private void grdDistProcessing_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { e.CellStyle.BackColor = Color.BurlyWood; e.CellStyle.ForeColor = Color.Black; } It should render faster too.

Categories : C#

TabControl Deep Copy
You're doing it all wrong. You're not supposed to "copy" the UI or whatever, because UI is Not Data. You should be manipulating and copying Data Items instead of UI elements, and probably using DataTemplates to have your Data items represented on screen. I strongly suggest that you research and learn MVVM before ever writing a single line of code in WPF.

Categories : C#

Binding With a TabControl DataTemplate
Finally figured it out . . . the code was not wrong and the problem resides in the RichTextbox. I am using the Xceed Extended WPF RichTextbox. Turns out you have to make the binding Readadble-and-Writable otherwise binding does not work. <toolkit:RichTextBox Text="{Binding Question}" IsReadOnly="True" />

Categories : C#

TabControl AddingTab event
I believe the event you're looking for is the Control.ControlAdded event: http://msdn.microsoft.com/en-us/library/system.windows.forms.control.controladded.aspx If that also detects when things inside the tab pages themselves are added, you should be able to filter out everything but TabPage controls using the ControlEventArgs.Control property in your event handler. To reject adding a control will be a little more complicated. Since this event seems to only be raised after the control gets added, you'll need to do something like this: void onControlAdded(object sender, ControlEventArgs e) { var tab = e as TabPage; if (tab == null) return; this.myTabControlObject.TabPages.Remove(tab); } This should remove the tab, but it will likely slow the tab adding process c

Categories : C#

WPF: right way to do a Tabcontrol with MVVM pattern
You should consider using an MVVM framework if you're using MVVM. With Caliburn.Micro for example, you can define your main view as: <TabControl x:Name="Items"> <TabControl.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding DisplayName}" /> </DataTemplate> </TabControl.ItemTemplate> </TabControl> Where the data context is a Conductor type that has a collection. The Items property will expose a collection of your view models: public class MainViewModel : Conductor<IScreen>.Collection.OneActive { private OneOfMyViewModels oneOfMyViewModels; private AnotherViewModel anotherViewModel; protected override void OnInitialise() { // Better to use constructor injection here

Categories : Wpf

How to fix left div when scrolling horizontally and fix top when scrolling vertically (Excel like)?
Try this: CSS: .HeaderRow { position:fixed;//For vertical purposes } Javascript(JQUERY): var posWas = $(window).scrollLeft(); $(window).bind('scroll', function(){ var posIs = $(window).scrollLeft(); if(posWas !== posIs){ //Scrolled Horizontal $('.headerRow').css("position" , "relative"); $('.headerRow').css("left" , posIs ); $('.headerRow').css("position" , "fixed" ); posWas = posIs;//Save it for the Next Run } //Scrolled vertically keep as you are }); If you want to fix another class or div please change it in the code.

Categories : Javascript

Sticky sidebar: stick to bottom when scrolling down, top when scrolling up
I was looking for the exact same thing. Apparently I needed to search for some obscure terms just to find a similar question with the graphic. Turns out it's exactly what I was looking for. I couldn't find any plugins so I decided to make it myself. Hopefully someone will see this and refine it. Here's a quick and dirty sample html I'm using. <div id="main"> <div class="col-1"> </div> <div class="col-2"> <div class="side-wrapper"> sidebar content </div> </div> </div> Here's the jQuery I made: var lastScrollPos = $(window).scrollTop(); var originalPos = $('.side-wrapper').offset().top; if ($('.col-2').css('float') != 'none') { $(window).scroll(function(){ var rectbtfadPos = $('.rectb

Categories : Jquery

Auto vertical scrolling of RichTextBox on panel scrolling c#
in order to hide the scroll bars you can do richTextBox1.ScrollBars = RichTextBoxScrollBars.None; but the problem with it is that it makes the text warp. so you also need richTextBox1.WordWrap = false; once you've done that the rest isn't that easy too. register on the event of the panel scrolling and change the scroll on the rich text box. the problem is is that you can't just change is scrolling offset of the richTextBox, so you can use the Select method to jump to the place you need. you can use the length of the line to know what's the size of the scrollBar need to be. at the end, it's gonna be a hard time work. good luck

Categories : C#

jQuery - disable scrolling body, enable scrolling div
The question's comments already pointed out that this kind of implementation has some weaknesses. Therefore, I'd suggest to create a header and a footer and position both with position: fixed while the main search content will basically stay untouched (besides some kind of top and bottom padding to make space for the header and the footer).

Categories : Jquery

Disable scrolling when the animation of scrolling is taking place
At the beginning of your function, you could apply some CSS attributes to make it unscrollable. Then at the end of your animation, revert it back to normal. For example: At the beginning of your animation $('html, body').css({ 'overflow': 'hidden', 'height': '100%' }) Then, at then end $('html, body').css({ 'overflow': 'auto', 'height': 'auto' }) This is virtually the same thing as this answer: http://stackoverflow.com/a/17293689/2247151

Categories : Javascript

.Net correspondings of WinApi TabControl styles
If you want to just call SetWindowLong, try [DllImport("user32.dll")] static extern bool SetWindowLong(IntPtr ptr, int index, int value); If you are targeting 32-/64-bit platforms, this SO answer might throw some light on how to invoke the function properly.

Categories : C#

MVVM TabControl update ComboBox
You should notify the interface that ReadOnlyArray is changing after SelectedTabIndex changes. Assuming your view model implements INotifyPropertyChanged, you need to fire approppriate event hander: set { _selectedTabIndex = value; if (_selectedTabIndex == 0) { _readOnlyArray = ReadOnlyArrays.ReadOnlyColumnArrays.LoanerItemsSelect; } else if (_selectedTabIndex == 1) { _readOnlyArray = ReadOnlyArrays.ReadOnlyColumnArrays.CustomerSelect; } else if (_selectedTabIndex == 2) { _readOnlyArray = ReadOnlyArrays.ReadOnlyColumnArrays.JobSelect; } //Your helper method from base class calling // INotifyPropertyChanged.PropertyChanged event this

Categories : C#

How do I programatically change tab names in a WPF TabControl?
WPF is designed with data/UI separation in mind. One of the reasons you're having trouble finding a solution is because what you're trying to do is a no-no; instead of programmatically changing the UI's header text, you should be changing the underlying data instead, and allowing the WPF plumbing to update how the data is displayed. A WPF tab control can literally contain any type of object; you could fill it with integers or strings or FooBars or whatever. There's no guarantee that any of these objects will define a Header property, and it's up to the developer to configure data bindings or templates which instruct the TabControl just how a FooBar or a whatever should be displayed. In an ideal WPF application which adheres to the MVVM design pattern, you might have your TabControl bou

Categories : C#

space between tabs in tabcontrol Dotnetbar VB.NET
CreateTab method already adds the newly created tab to Tabs collection (see docs for the method) so you are adding it twice. Remove this code: TabControl1.Tabs.Add(newpage) Hope this helps.

Categories : Vb.Net

TabControl, TabItem, UserControl gets focus
Add a Boolean parameter to register if it is the first time that the GotFocushandler has been called: private isFirstTime = true; private void UserControl_GotFocus(object sender, RoutedEventArgs e) { if (isFirstTime) { EventTypeSelection.Items.Add("Focus caught!"); isFirstTime = false; } } Alternatively, you could move monitor the GotFocus event on the UserControl instead of handling the event on the ComboBox.

Categories : Wpf

Updating TabControl.DisplayRectangle manually
I have discovered a couple of things which help to fix this issue. They are; to resize the display rectangle using an override of the OnResize method, and to set the bounds for each tab in the tab control when you have finished resizing the display rectangle...e.g: protected override void OnResize(EventArgs e) { base.OnResize(e); this.displayRectangle = this.ClientRectangle; this.displayRectangle.Y += this.ItemSize.Height + 4; this.displayRectangle.Height -= this.ItemSize.Height + 4; foreach(TabPage page in this.TabPages) { page.SetBounds( this.DisplayRectangle.X, this.DisplayRectangle.Y, this.DisplayRectangle.Width, this.DisplayRectangle.Height, SpecifiedBounds.All ); } this.Re

Categories : C#

What is expected behavior of TabControl.ControlRemoved?
It is simply an order-of-execution problem. The TabCount property doesn't get updated until after the ControlRemoved event fires. These kind of problems are fairly common with events. You fix this by executing the code after the event is raised and all processing is completed: private void tabControl1_ControlRemoved(object sender, ControlEventArgs e) { this.BeginInvoke(new Action(() => { MessageBox.Show(tabControl1.TabCount.ToString()); })); }

Categories : C#

How to change the color of the selected tab in the TabControl?
Alright...after hours of trying, I have realized that the TabItem selection behaviour is defined at the Template level. So, if I wana change the backgrnd color, I do this: <Window.Resources> <Style TargetType="{x:Type TabItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TabItem}"> <Border> <Grid> <Grid> <Border x:Name="border" CornerRadius="3,3,0,0" Background="WhiteSmoke"/> </Grid>

Categories : C#

Strange behavior with two-way Binding and TabControl
It happens because TextBox's update trigger is set to LostFocus by default. Change it to PropertyChanged, and it should work: <TextBox Text="{Binding Path=MyFirstText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> UpdateSourceTrigger: http://msdn.microsoft.com/en-us/library/system.windows.data.updatesourcetrigger.aspx

Categories : Wpf

Strange issue with a datagridview and a tabcontrol C#
THe only thing I can se at the moment is that you are not doing this on tabpage 2 dataGridView1.Sort(dataGridView1.Columns[1], ListSortDirection.Ascending); try dataGridView2.Sort(dataGridView2.Columns[1], ListSortDirection.Ascending);

Categories : C#

Totally independent forms in tabcontrol
There's no need to have separate modules/forms to run more than one task simultaneously. The issue you are having with the UI freezing is you are running all operations on the primary thread. You need to multithread the application. Do a quick search on stackoverflow for multithreading vb.net. If you can't find anything let me know and I'll do the search and provide links.

Categories : Vb.Net

How to change Winform TabControl location
As you said you like to add MenuStrip to top but TabControl accommodates top position. It doesn't matter when you add a MenuStrip it always goes to top. Try it.

Categories : C#

TabControl - Making a TabItem appear on top of the Content
Couldn't you change the ControlTemplate of the TabControl? The problem seems to be that the default ControlTemplate (http://msdn.microsoft.com/en-us/library/ms754137(v=vs.110).aspx) has the ContentPresenter declared after the TabPanel, effectively forcing it above in Z-order. A simple solution may be to simply copy this from the link provided, paste it in and reverse the order of the TabPanel and the Border elements (some adjustments may be required as the Border may now sit on top of the TabPanel altogether, blocking it's view). <Style TargetType="{x:Type TabControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TabControl}"> <Grid KeyboardNavigation.TabNavigation="Local">

Categories : Wpf

WPF TabItem and TabControl templates combined
You could get something similar by changing the background color to a gradient on the TabItem: <Style TargetType="TabItem"> <Style.Triggers> <Trigger Property="IsSelected" Value="False"> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientStop Color="#eeeeee" Offset="0.0"/> <GradientStop Color="#eeeeee" Offset="0.6"/> <GradientStop Color="#b6b6b6" Offset="1"/> </LinearGradientBrush> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style>

Categories : Wpf

displaying multiple datatable in tabcontrol C#
Because your dgw size is 0,0 either set size: dgw.Size = new Size(100, 100); or set dock type to fill: dgw.Dock = System.Windows.Forms.DockStyle.Fill;

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.