VB.Net Image is not Showing at Runtime - vb.net

Button image and icon is not showing at runtime
Button Image
Me.wibtnAdd.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
Me.wibtnAdd.DisabledImagesGrayScale = False
Me.wibtnAdd.Enabled = False
Me.wibtnAdd.Image = CType(resources.GetObject("wibtnAdd.Image"), System.Drawing.Image)
Me.wibtnAdd.ImageFixedSize = New System.Drawing.Size(24, 24)
Me.wibtnAdd.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top
Me.wibtnAdd.Location = New System.Drawing.Point(53, 302)
Me.wibtnAdd.Name = "wibtnAdd"
Me.wibtnAdd.Shape = New DevComponents.DotNetBar.RoundRectangleShapeDescriptor(2)
Me.wibtnAdd.Size = New System.Drawing.Size(61, 52)
Me.wibtnAdd.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled
Me.wibtnAdd.TabIndex = 8
Me.wibtnAdd.Text = "Add"
Form Icon
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)

to make your code more clear : 1) get rid of the 'Me'
2) use a 'With' clause
(i edited)
the issue seems to be in your access to resources : are you sure
you have a resource named "wibtnAdd.Image" ? it seems 'strange'
that it has same name as your object/property... Check your
wibtnAdd.Image, it might be Nothing. Same for your Icon.
Btw why not doing this in xaml ?? it would be much more readable,
and you can edit everything while seeing results.

Related

Set width of toolbar button defined in cl_gui_toolbar

I've got a toolbar defined with class cl_gui_toolbar which is displayed in a container (which got created via class cl_gui_custom_container). I've added some buttons and button groups into it.
Now my user wants one of those button groups to be bigger, because the user might not recognize that the button is there. Is there any method to set the width of the button-group?
Here is my current code:
METHOD init_toolbar.
DATA: lt_buttons_data TYPE ttb_button,
ls_button_data TYPE LINE OF ttb_button.
go_toolbar_container = NEW cl_gui_custom_container( container_name = 'TOOLBAR_1000' ).
go_toolbar = NEW cl_gui_toolbar( parent = go_toolbar_container ).
" Some other buttons
" ...
" ...
CLEAR ls_button_data.
CLEAR lt_buttons_data.
ls_button_data-function = 'DBFILTER'.
ls_button_data-icon = '#EX#'.
ls_button_data-quickinfo = 'Quickinfo'.
ls_button_data-text = 'SmallText'.
ls_button_data-butn_type = cntb_btype_menu.
APPEND ls_button_data TO lt_buttons_data.
go_toolbar->add_button_group( data_table = lt_buttons_data ).
CLEAR ct_expand.
ct_expand = NEW cl_ctmenu( ).
ct_expand->add_function( fcode = '1' text = '1' checked = abap_false ).
ct_expand->add_function( fcode = '2' text = '2' checked = abap_false ).
ct_expand->add_function( fcode = '3' text = '3' checked = abap_false ).
CLEAR wa_ctxmenu.
wa_ctxmenu-function = 'DBFILTER'.
wa_ctxmenu-ctmenu = ct_expand.
APPEND wa_ctxmenu TO table_ctxmenu.
go_toolbar->assign_static_ctxmenu_table( table_ctxmenu = table_ctxmenu ).
ENDMETHOD.
Do you know a way how to set the width of this button-group?
PS: I just got the info, that the text of the button ( e. g. "smallText" ) can be replaced if a longer text, if there is no other way .
It's not possible to customize the width of a button in class CL_GUI_TOOLBAR as a number of pixels.
As a workaround:
Enter a longer text. Maybe enter "non-breaking spaces" at the end of your text. This is the Unicode character U+00A0 (CL_ABAP_CONV_IN_CE=>UCCP( '00A0' )).
Instead of CL_GUI_TOOLBAR, use the class CL_GUI_HTML_VIEWER to define the buttons with HTML code and CSS styles. But I doubt it's worth spending time for that.

Is there a way to color console.log messages in WebStorm like dev tools?

Is there a way to color console.log messages in WebStorm like dev tools?
see image
Yes. You could do something like:
console.log('\x1b[36m%s\x1b[0m', 'I am cyan'); //cyan
%s is where in the string gets injected.
Colors reference
Reset = "\x1b[0m"
Bright = "\x1b[1m"
Dim = "\x1b[2m"
Underscore = "\x1b[4m"
Blink = "\x1b[5m"
Reverse = "\x1b[7m"
Hidden = "\x1b[8m"
FgBlack = "\x1b[30m"
FgRed = "\x1b[31m"
FgGreen = "\x1b[32m"
FgYellow = "\x1b[33m"
FgBlue = "\x1b[34m"
FgMagenta = "\x1b[35m"
FgCyan = "\x1b[36m"
FgWhite = "\x1b[37m"
BgBlack = "\x1b[40m"
BgRed = "\x1b[41m"
BgGreen = "\x1b[42m"
BgYellow = "\x1b[43m"
BgBlue = "\x1b[44m"
BgMagenta = "\x1b[45m"
BgCyan = "\x1b[46m"
BgWhite = "\x1b[47m"
Details: https://stackoverflow.com/a/41407246/2589276
No, it's not possible; styling console output is not supported. Please vote for WEB-12349 to be notified on any progress
worked for me like this:
var red = ['color: red'].join(';');
and to output:
console.log("%c I'm RED!",red)
EDIT: Works for me only in Chrome and Firefox

Programmatically Creating Attributes - Prestashop 1.6

I am programmatically adding attributes to Prestashop 1.6 as follows:
$newGroup = new AttributeGroup();
$newGroup->name = $this->createMultiLangField('test');
$newGroup->public_name = $this->createMultiLangField('test');
$newGroup->group_type = 'select';
$newGroup->add();
$newAttribute = new Attribute();
$newAttribute->name = $this->createMultiLangField('test');
$newAttribute->id_attribute_group = $newGroup->id;
$newAttribute->add();
When I look in my catalog this attribute and its group are there and everything appears to be in order. However, when I click combinations on any of my products after doing this, the ajax loader spins out indefinately (I can no longer create combinations on ANY of my products). Has anybody experienced anything like this?
The code should be:
$newGroup = new AttributeGroup();
$newGroup->name = $this->createMultiLangField('test');
$newGroup->public_name = $this->createMultiLangField('test');
$newGroup->group_type = 'select';
$newGroup->add();
$newAttribute = new Attribute();
$newAttribute->name = $this->createMultiLangField('test');
$newAttribute->id_attribute_group = $newGroup->id;
$newAttribute->add();

vb - I am trying to print other form but this happens:

(this is my first post so correct me if I'm doing something wrong.)
Here is a bit of my code:
imp.id.Text = globalvars.mdataset.Tables("table1").Rows(0).Item("id")
imp.date.Text = globalvars.mdataset.Tables("table1").Rows(0).Item("date")
imp.hour.Text = globalvars.mdataset.Tables("table1").Rows(0).Item("hour").ToString
imp.PrintForm1.PrinterSettings.DefaultPageSettings.Margins = New Printing.Margins(10, 10, 10, 10)
imp.Show()
imp.Focus()
imp.PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
imp.PrintForm1.Print()
and what happens is that when it gives me the preview the page is empty... but the weird thing is that when i place a msgbox just before the printing action, the preview goes right and shows me what i want to print....
any tips?
EDIT: imp is the form where the printform is
Try to add this ..
....
Application.DoEvents
imp.PrintForm1.Print()

How to use datagraphwindow of arcgis programmatically

I have been trying to plot a map on axmapcontrol and use the same ITable to create a scatterplot graph in IDataGraphwindow2. Unfortunately the graph appears with correct data but no click events on the graph are working. The left click shows a memory error and the right click shows a disabled menu. For left click I think DataGraphTUI.dll is responsible. When we load the IDataGraphWindow2, we don’t initialize this due to which probably it gives an error.
Please find the code below.
IDataGraphWindow2 pDGWin;
IDataGraphT dataGraphT = new DataGraphTClass();
IWorkspace shapefileWorkspace = null;
IWorkspaceFactory shapefileWorkspaceFactory = new ShapefileWorkspaceFactoryClass();
shapefileWorkspace = shapefileWorkspaceFactory.OpenFromFile("C:\\abc.shp "), 0);
featureWorkspace = (IFeatureWorkspace)shapefileWorkspace;
featureLayer.FeatureClass = featureWorkspace.OpenFeatureClass(System.IO.Path.GetFileNameWithoutExtension("c:\\abc.shp"));
ITable gobjJoinedTable = (ITable)featureLayer.FeatureClass;
LoadaxMap(); /// a method to load up the axmapcontrol
dataGraphT.UseSelectedSet = true;
dataGraphT.HighlightSelection = true;
dataGraphT.GeneralProperties.Title = "Scatter Graph";
dataGraphT.LegendProperties.Visible = false;
dataGraphT.get_AxisProperties(0).Title = "Y Axis";
dataGraphT.get_AxisProperties(0).Logarithmic = false;
dataGraphT.get_AxisProperties(2).Title = "X Axis";
dataGraphT.get_AxisProperties(2).Logarithmic = false;
ISeriesProperties seriesProps = dataGraphT.AddSeries("scatter_plot");
seriesProps.SourceData = axMap.get_Layer(0) as ITable; // axMap is the map control. Itable direct binding also works here
seriesProps.SetField(0, "abc.shp-fieldname"); // you may add any fieldname
seriesProps.SetField(1, "abc.shp-fieldname");
dataGraphT.Update(null);
dataGraphT.UseSelectedSet = true;
dataGraphT.HighlightSelection = false;
dataGraphT.Update(null);
pDGWin = new DataGraphWindowClass();
pDGWin.DataGraphBase = dataGraphT;
pDGWin.PutPosition(546, 155, 1040, 540);
pDGWin.Show(true);
The memory error is
Access violation at address 0F4E358B in module 'DatagraphTUI.dll'. Read of addess 00000000
Had the same problem while displaying the graph.
Fixed it by using this line of code:
graphWindow.Application = ArcMap.Application
All it needs is a reference to the ArcMap Application.