Padding/ Size / Margin When Using ToolstripControlHost For A Popup Control?
Nov 11, 2011
I'm using VB2008 Express. And I've been working on a "popup" to select a date range. The DateTimePicker isn't ideal because the purpose is to pick a date range, which will always be one full week, from Sunday through Saturday. The control works just fine and I'm pretty proud of it. My problem has to do with the border added when using ToolstripControlHost for this. I've included a screenshot and my code.
In the code below, assume there exists a button named "btnTimePeriod", below which I desire to show a panel, which contains a few custom items, and the panel's name is "pnlDateRangePicker".IT WORKS... but it doesn't look right. The panel itself is 147 x 326 pixels, but notice in the attached graphic that it's adding a border around the panel which I don't want. There's a border on the top, bottom, and left... but for some reason the border on the right one is especially large. Although my code doesn't expressly set it, AutoSize = true so I would have expected it to shrink around the panel.
As required, my code already does set ShowCheckMargin and ShowImageMargin false. I haven't included the code for the DrawDateCalander Sub because it's not relevant. I believe even a blank panel would yield the same result. I have no idea where this margin is coming from.
Private Sub btnTimePeriod_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimePeriod.Click
Call DrawDateCalendar(DatePart(DateInterval.Month, FirstDisplayedSunday), DatePart(DateInterval.Year, FirstDisplayedSunday))
Call ShowControlBelow(btnTimePeriod, pnlDateRangePicker)
End Sub
1. How to get 0 padding/inner margin in the cells? I want just the border as a colored line at the next close pixel to the control in the cell. Or if border set to none, I want the controls with no gap.
2. How do I actually add/remove rows& columns? I thought this was by setting the .ColumnCount property, but if I set it to 3, and then try to access the third column, it gives exception, so it's obviously just two columns, although it also looks like 3 on the form. ? I created it in designer with 2 columns though. But I don't understand how this hangs together..
Dim z0, z1, z2 As New ZedGraphControl z0.Dock = DockStyle.Fill z1.Dock = DockStyle.Fill
I'm using a sunken label style and back color with a statusbar, no matter what settings I change, like hiding the grip and setting the grip margin to all 0, there's still a section on the right that won't go away. I want my status label to stretch all the way across the statusbar, is this possible?
I came across a post a while back which showed a custom rich textbox control which had line numbers in its margin. Similar to what you woudl see if you we coding in the VB designer and you had your line numbers viewable.
I think it was two controls in one (i.e. two textboxes: one for the numbers, and the other for the text). However I cannot remember where I saw it.
If you have a Control contained within another Control and the Child Control has the default Anchoring (Top + Left) AND AutoSize=False (Assuming the control has that Property) changing the Parent Control's Top or Left Padding will not offset the Child Control.If you change the Anchoring of the Child Control to anything other than the default values OR set AutoSize=True, the Control is correctly offset when the Parent Control's Padding values are changed.
I have wondered the solution to this question for many years! I doubt if anyone else knows much about it because the internet is absolutely zero help in this!
I have made a form1 with a webbrowser control on it. When the program is run it brings up the homepage (which is Google). However the homepage doesn't seem to fit inside the webbrowser control.
So I am hoping that someone could tell me how to make the (...I dunno how to ask this retarded question...) webpage fit completely (100%) inside the size of the webbrowser control. Meaning...I would like to see the entire webpage from the internet in the size of the webbrowser control. To fill the entire size (whatever size I want).
Etc... if my webbrowser ontrol is seh, set to 600px by 400px, how can I program this so when it brings up the homepage (or any other page), it fills the entire size of the webbrowser control? Without any scrollbars. How to make the contents from the web (or local) fill the size of the webbrowser - almost like a mini browser if you will.
I am writing a kiosk type application, in winforms (I know WPF would be better, this is just to be a rough and ready solution until I've learnt WPF), using VB.Net (VS2008).I have a label on my form with the font set to Segoe UI, and at 120pt size (yes it's large, it's designed to be read from a distance on a 42" screen).The problem I have is that the automatic internal padding is pushing my text 60 pixels from the top of the control to the top of the text and 40 pixels from the left of the control to the left of the text - the label1.padding property is all at 0, so this is the default spacing of the control - it seems to be particularly bad with this font (but it's the font I want to use) and if I increase the font size, this issue gets even worse.
I want my text to fit tightly into the boundaries of my control top, bottom and left (I want the right to expand depending on the length of the string in it, though). How can I achieve this (so that I can control all of the paddding myself using the label.padding property) and get rid of this automatic padding?
I am trying to remove the white space around a toolstripcontrolhost control which hosts a calendar control in a contextmenu. See the attached image and code.
VB: Dim menuItem As ToolStripMenuItem = New ToolStripMenuItem("MyMenu") Dim calControl As New MonthCalendar
I'm trying to show a small DataGridView in my ContextMenuStrip that I have built. The DataGridView will show a unique list of values in a DataGridViewTextboxColumn "Sample ID" when its column header is right-clicked. I can get the unique values just fine, but I'm having trouble displaying the small DataGridView in the ContextMenuStrip. It currently looks like this.Notice, there is no data in the DataGridView. I have confirmed that the DataGridView.DataSource has several rows in it, yet the DataGridView shows nothing. Plus, I need to increase the size of my DataGridView, thus increasing the size of the ContextMenuStrip to show the DataGridView.
Public Class ContextMenu_Column_String Inherits ContextMenuStrip Private dvs As DataGridViewSettings
I hope you'll humor me with this, but I can't wrap my brain around it. I am attempting to add a ToolStripControlHost(DateTimePicker) to a MDIParent form, which will be used to call a method which shows the Child form(s). I have no problem with the adding the DateTimePicker, the showing of children, etc., but how to call the method from event(.ValueChanged?) of ToolStripControlHost? Despite much Googling and reading I'm not very clear on the entire event handler code. The following is where I currently am:
I am after a property that makes a control (textbox, datagrid or other) move according to the forms size. Because some of the controls I got does that, and I really don't want it. I've been looking at them but could not find it
I'm writing a couple of custom controls in VB.Net 3.5, in VS2008, and would like to resize the font size based on the height of the control, and vice-versa. Is there any way of converting a font of say 38.25pts into a me.height, or the other way round?
I realise the font width will change dependent on the font used (which isn't an issue for my purposes), but as far as I know, the font height is usually consistent Accessibility/Large font settings won't be an issue with this application.
I downloaded the extended webbrowser control created by Matt Kleinwaks (thank you for sharing that).I am using the control to fill out forms on a website. The website uses a popup that contains an html form. The popup form will not close if I click the the html submit button or the close button (it does when using a regular browser). The bigger problem I am having is that when the popup reopens, it contains data in the html boxes that was I have already submited on a previous iteration of the popup. Like it is being cached or something. I am wondering if this has to do with the html buttons not working properly.I basically hit submit on the form, the browse rcontrol hangs up, then I close the form manually. Is there a line of code or something I can add to get it to work right? Like clearing a cookie or disposing of the popup form after I close it?
I am using a WebBrowser to load a webpage. In that page, there are several links. When clicking on one, it opens and then immediately closes. IE7's popup blocker is set to allow all from this site, nor does it work even if the popup blocker is completely disabled. I have no other blocker running.
Hello: i have javascript code for a popup calendar and works fine if a form is a form control: <form id="FormView1" runat="server">
however, if i use my formview control w/ the same code for a formview control, it doesn't put the value back into my text box txtDate after the user selects the date:
this seems to be the only difference so i was wondering if perhaps i need to reference this form in a different way? i don't know why it won't work for my formview control.
After a little research, I managed to get a working Help button added to my form. I did this by setting the MinimizeBox and MaximizeBox properties of the form to false, set the ShowHelp property of the form to true and added a HelpProvider component. I then added a string to each control's HelpString property that I want to display help on.
Everything works with one minor exception. When I clcik the help button in the form and then select a control, the HelpString (tooltip) is displayed in the far lower left corner of the screen. I assumed I would see this pop up at the cursor rather than where it is. I cannot seem to find a property to control the position of the HelpString popup.
im trying to make a popup blocker type message box that pops up when a popup tries to load a page, and it asks The page [URL]is trying to open,open in a new tab?
(label) No (button) Yes (button)
how would i make a menu appear when i click somwhere on the page,how would i make it recognise a picture, and be able to copy it to a location on the local drive?
I'm trying to use the WebKit-component ([URL]) in VB with the help of Visual Studio 2008. This is running without problems, except for two following two issues:
1. Hints/Tooltips are not shown (e.g. as there usually will appear one if you stay with the mouse over the Google-logo)
2. If there's a popup-window, I don't know how to get the new desired URL.
This control takes in an array and plots a bar chart type 'count' along the Y axis for a corresponding X location. A user has requested to be able to mouse hover over any location on the graph and have it display the X and Y coordinates.
Option Strict On Option Explicit On Imports System.Windows.Forms
I have a problem I am trying to set the parent textbox from the modal popup.
Although I found the control from the modal popup with the below code DirectCast(Parent.Page.Form.FindControl("ContentPlaceHolder1").FindControl("myAccordion").FindControl("txtTo"), TextBox).Text = str
This is being called on button click when the user has finished selecting from the Checkboxlist.
When the parent page is shown again though the textbox is empty.
The scenario of my user control is that a user is to select from a checkbox list which is a list of emails.
When done has been clicked then it is required that the selected emails be forwarded to the parent webpage.
Then the To Textbox in this case will be filled with the emails that the user has selected.
I'm working with a Silverlight Popup control (SL4). I would like to update data shown on that popup every time the user opens it (IsOpen=true) by passing a string and calling a Private method located in the Popup control behind code to fetch updated data.
I was hoping to place code to make this happen in the Opened event of the Popup, but such an event does not seem to exist (even though I found some documentation on it).
I have a usercontrol that has a popup that displays another usercontrol when the user selects an item from a listbox. When the parent initializes, all the usercontrols initialize.
I am using an embedded webbrowser control to access a third-party website, populate the username and password boxes on their front page, and login. The problem I have is that the resulting window that the site returns to me is in the form of a new window. What I want to do is capture this window and all it's session/cookie data in to the original webbrowser control, as even if I direct the original window to the same resulting url, some kind of authentication data is missing and the site tells me I have logged out, even though the popup window works fine. I need that page in the original control so that I can continue to access it programmatically, and I don't really want to get in to the complication of accessing the new window, as I expect I'll have to delve in to the api or something.
how I can control the tool tip popup or make calls to the text that displays based on a integer value. I'm wanting it to display a text based on a interger value inside an if statment for a picture box. So if the ingteger = 1 then tooltip.text = "" else tooltip.text = "" but that is not the correct syntax.
I can print and almost everything works. Basically I used KB 811401 to create a RichTextBoxPrintCtrl.dll and add it to my tool box. I have a Page Setup and a Page Print. I call Setup and change the margins. Then I call print. But I always get default margins. The margin settings I put in the Page Setup don't "take".
Here is my relavant application code. Private Sub btnPageSetup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) [Code] .....
So, I'm adding a label programatically and I'm in need of altering the top margin a little bit to the value 8. I can't do that the obvious way, so what's wrong with my thinking?
Dim LabelAdapter As New Label LabelAdapter.text = "Adapter" LabelAdapter.Margin.Top = 8
This gives me the error "Expression is a value and therefore cannot be the target of an assignment".
I've built an app, that draws text to four rectangles on a pre-printed page with a design, I'm wondering what the margin refers to?
Also our printer doesn't print all the way to the edge, there's a white border, about the height of this little guy:If I printed from a printer that prints to the edge, will the text be in the same position as it would be if it was printed with the border around it, the text should be in the exact same position right?